From a577544fac8dda55289fc6b1d596968390b07e3b Mon Sep 17 00:00:00 2001 From: Slaith <34562469+Slaith12@users.noreply.github.com> Date: Thu, 17 Mar 2022 18:44:58 -0700 Subject: [PATCH] Fixed space soccer ball spawning when it shouldn't be The soccer ball that is part of the prefab no longer defaults to the Dispensing state (when i refactored the ball script a while ago, i dealt with this problem by just disabling that ball, but this solution should work even with the ball enabled) --- Assets/Scripts/Games/SpaceSoccer/Ball.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Games/SpaceSoccer/Ball.cs b/Assets/Scripts/Games/SpaceSoccer/Ball.cs index 1239b9b1..aa0ede21 100644 --- a/Assets/Scripts/Games/SpaceSoccer/Ball.cs +++ b/Assets/Scripts/Games/SpaceSoccer/Ball.cs @@ -9,7 +9,7 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer { public class Ball : MonoBehaviour { - public enum State { Dispensing, Kicked, HighKicked, Toe }; + public enum State { None, Dispensing, Kicked, HighKicked, Toe }; [Header("Components")] [HideInInspector] public Kicker kicker; [SerializeField] private GameObject holder; @@ -95,7 +95,7 @@ namespace HeavenStudio.Games.Scripts_SpaceSoccer } } } - if(state == 0) //if the for loop didn't set the state + if(state == 0) //if the for loop didn't set the state, i.e. all the high kicks happen before the point we start at. { //Debug.Log("Defaulting to kicked state"); state = State.Kicked;