From 71aa4ac46a5721e4cca6579ab8a1342b9e7c7102 Mon Sep 17 00:00:00 2001 From: Spencer Beaumont Date: Mon, 22 Apr 2024 17:41:44 -0400 Subject: [PATCH] Gravity now resets to floor if switching levels while on the ceiling --- Assets/Scripts/PlayerMovement.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/Scripts/PlayerMovement.cs b/Assets/Scripts/PlayerMovement.cs index 805994e..8b09dab 100644 --- a/Assets/Scripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerMovement.cs @@ -18,6 +18,12 @@ public class PlayerMovement : MonoBehaviour [SerializeField] AudioSource reverseGrav; [SerializeField] bool hasGravityController = true; + + void Awake() + { + Physics2D.gravity = new Vector2(0.00f, -9.81f); + } + // Start is called before the first frame update void Start() {