From 6efd4bd0d1c0e231e0b99b74cc5cb27d7618fe68 Mon Sep 17 00:00:00 2001 From: nexovec Date: Sat, 29 Jan 2022 21:29:04 +0100 Subject: [PATCH] implemented player falling switch --- Assets/Scripts/PlayerController.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index 259e493..8666acd 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -113,6 +113,16 @@ public class PlayerController : MonoBehaviour jump = false; } + if(rb.velocity.magnitude != 0 && rb.velocity.normalized == this.downDirection.normalized) + { + // Debug.Log("Player is falling :)"); + this.isFalling = true; + } + else + { + this.isFalling = false; + } + if (saveDirection != Vector3.zero) { Vector3 axis;