From b3594dcad4fc809676b88e32685664ab65e05a56 Mon Sep 17 00:00:00 2001 From: orsolya-st Date: Sat, 6 Jun 2026 02:43:16 +0200 Subject: [PATCH] dropwdown --- Game/Assets/Scripts/DropletMovement.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Game/Assets/Scripts/DropletMovement.cs b/Game/Assets/Scripts/DropletMovement.cs index 400991a..04f67e2 100644 --- a/Game/Assets/Scripts/DropletMovement.cs +++ b/Game/Assets/Scripts/DropletMovement.cs @@ -8,6 +8,7 @@ public class DropletMovement : MonoBehaviour // helper variables private bool isGrounded = true; private float facingDirection = 1f; + private bool isDropping = false; // movement private Vector2 movement; @@ -62,10 +63,10 @@ public class DropletMovement : MonoBehaviour private void FixedUpdate() { - if (isDashing) - { - return; - } + if (isDashing || isDropping) + { + return; + } rb.linearVelocity = new Vector2(movement.x * moveSpeed, rb.linearVelocity.y); } @@ -138,6 +139,7 @@ public class DropletMovement : MonoBehaviour while (elapsed < duration) { + isDropping = true; rb.gravityScale = 0; transform.Translate(Vector3.down * speed * Time.deltaTime); elapsed += Time.deltaTime; //update time @@ -147,6 +149,7 @@ public class DropletMovement : MonoBehaviour //enable collider --> not a trigger anymore rb.gravityScale = 1; playerCollider.isTrigger = false; + isDropping = false; } } \ No newline at end of file