From da1512731b78c305716b1285fe45f03fd9d5e5ac Mon Sep 17 00:00:00 2001 From: Miguel Astor Date: Tue, 4 Aug 2026 02:07:47 -0400 Subject: [PATCH] TO SQUASH: Fixed issue with collisions with destroyed balls. --- Assets/Scripts/Game/BallSpawner.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Assets/Scripts/Game/BallSpawner.cs b/Assets/Scripts/Game/BallSpawner.cs index a8d38cf..3732700 100644 --- a/Assets/Scripts/Game/BallSpawner.cs +++ b/Assets/Scripts/Game/BallSpawner.cs @@ -135,8 +135,11 @@ public class BallSpawner : MonoBehaviour // As an exception, glass balls will collide with other glass balls. foreach (var ball in balls) { + if (ball == null) continue; + foreach (var otherBall in balls) { + if (otherBall == null) continue; if (ball == otherBall) continue; bool ballIsBasicOrFruit = ball.CompareTag("BasicBall") || ball.CompareTag("FruitBall");