From 475defbd6ba8c2415f3081f5cf9c90612788b921 Mon Sep 17 00:00:00 2001 From: Miguel Astor Date: Wed, 5 Aug 2026 01:48:00 -0400 Subject: [PATCH] TO SQUASH: Fixed issue with bar hit sound being played multiple times. --- Assets/Scripts/Game/Balls/BallBase.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Game/Balls/BallBase.cs b/Assets/Scripts/Game/Balls/BallBase.cs index ebb390b..c08b4fe 100644 --- a/Assets/Scripts/Game/Balls/BallBase.cs +++ b/Assets/Scripts/Game/Balls/BallBase.cs @@ -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");