Unity To Android - Simple If Statement Not Working November 26, 2023 Post a Comment Just tested my game in Unity editor and all works fine: void Update () { if (transform.position.y < -3f) { Debug.Log ('game over!'); prepareGamSolution 1: It's best practices not to compare float values.Solutions:1) Use Mathf.Approximately(float a, float b) link2) Use Mathf.RoundToInt(float f) link3) Use triggers. This might be more than you need for this solutionI don't have enough rep to link #3 but lookup Collider.OnTriggerEnter(Collider) Share Post a Comment for "Unity To Android - Simple If Statement Not Working"
Post a Comment for "Unity To Android - Simple If Statement Not Working"