From 8b95aab282b982ce26b1e6980c27a818f58ce8b3 Mon Sep 17 00:00:00 2001 From: finnchen123 Date: Fri, 13 Feb 2026 18:44:46 +0100 Subject: [PATCH] Added a jump delay variation to each slime to make the jumps seem more natural --- Assets/Scripts/InteractableObjects/Enemy.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/InteractableObjects/Enemy.cs b/Assets/Scripts/InteractableObjects/Enemy.cs index fa09ad1..c49559f 100644 --- a/Assets/Scripts/InteractableObjects/Enemy.cs +++ b/Assets/Scripts/InteractableObjects/Enemy.cs @@ -20,6 +20,7 @@ namespace Assets.Scripts.InteractableObjects Stopwatch jumpTimer; bool followsPlayer; Fight fight; + int jumpResetModifier; // Start is called before the first frame update void Start() @@ -44,6 +45,7 @@ namespace Assets.Scripts.InteractableObjects { jumpTimer.Start(); isJumping = true; + jumpResetModifier = rand.Next(-500, 500); Vector3 jumpVector; if (followsPlayer) { @@ -57,7 +59,7 @@ namespace Assets.Scripts.InteractableObjects } gameObject.GetComponent().AddForce(jumpVector, ForceMode.Impulse); } - if (jumpTimer.ElapsedMilliseconds >= 5000) + if (jumpTimer.ElapsedMilliseconds >= 5000 + jumpResetModifier) { jumpTimer.Reset(); isJumping = false;