From f120b487ecd43a10916f4fdc40c8ecd9406c52fc Mon Sep 17 00:00:00 2001 From: Pierre Ryssen Date: Thu, 30 Apr 2026 18:48:17 +0200 Subject: [PATCH] feat (root enemies): entrave the jump of the player when in area --- Assets/Code/Scripts/Enemies/LivingRoot/SlowdownArea.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Assets/Code/Scripts/Enemies/LivingRoot/SlowdownArea.cs b/Assets/Code/Scripts/Enemies/LivingRoot/SlowdownArea.cs index e809da5..4bcab53 100644 --- a/Assets/Code/Scripts/Enemies/LivingRoot/SlowdownArea.cs +++ b/Assets/Code/Scripts/Enemies/LivingRoot/SlowdownArea.cs @@ -9,14 +9,19 @@ public class SlowdownArea : MonoBehaviour public float timer; private float baseSpeed; + private float baseJump; private bool isInZone = false; private PlayerMovement player; + private PlayerJump jump; private void OnTriggerEnter(Collider area) { if (area.CompareTag("Player")){ player = area.GetComponent(); + jump = area.GetComponent(); baseSpeed = player.WalkSpeed; + baseJump = 5.0f; + jump.JumpForce = 1.5f; isInZone = true; } } @@ -28,6 +33,7 @@ public class SlowdownArea : MonoBehaviour isInZone = false; timer = 0f; player.WalkSpeed = baseSpeed; + jump.JumpForce = baseJump; } } @@ -41,6 +47,5 @@ public class SlowdownArea : MonoBehaviour float t = Mathf.Clamp(timer * slowSpeed, 0f, 1f); float multiplicator = Mathf.Lerp(1f, maxSlow, t); player.WalkSpeed = baseSpeed * multiplicator; - } }