TO SQUASH: Fixed issue with bar hit sound being played multiple times.

This commit is contained in:
2026-08-05 01:48:00 -04:00
parent 8fdefdc1a6
commit 475defbd6b
+4 -1
View File
@@ -18,7 +18,10 @@ public class BallBase : MonoBehaviour
{
if(other.gameObject.CompareTag("Bar"))
{
audioSource.PlayOneShot(hitSound);
if (!audioSource.isPlaying)
{
audioSource.PlayOneShot(hitSound);
}
// Destroy all bar segments when the ball hits a bar.
var barSegments = GameObject.FindGameObjectsWithTag("Bar");