From d86c98d5174007d2017bced81bf56746a42fbaaa Mon Sep 17 00:00:00 2001 From: go38coz Date: Sat, 6 Jun 2026 02:44:48 +0200 Subject: [PATCH] try to fix --- Game/Assets/Scripts/DropletMovement.cs | 17 +++++------------ Game/ProjectSettings/EditorSettings.asset | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Game/Assets/Scripts/DropletMovement.cs b/Game/Assets/Scripts/DropletMovement.cs index cd8b0b6..f957b51 100644 --- a/Game/Assets/Scripts/DropletMovement.cs +++ b/Game/Assets/Scripts/DropletMovement.cs @@ -110,21 +110,11 @@ public class DropletMovement : MonoBehaviour isGrounded = false; } - private void DropDown() - { - //when "s" or "down key" is pressed turn of/disable collider; - //move object slowly down (1 seconds, move down the height of the collision box) - //after that enable collider again - - if (isGrounded && (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow))) - { - StartCoroutine(DropRoutine()); - } - } - + private IEnumerator DropRoutine() { Collider2D playerCollider = GetComponent(); + rb = GetComponent(); playerCollider.isTrigger = true; @@ -137,12 +127,15 @@ public class DropletMovement : MonoBehaviour while (elapsed < duration) { + rb.useGravity = false; transform.Translate(Vector3.down * speed * Time.deltaTime); elapsed += Time.deltaTime; //update time yield return null; } //enable collider --> not a trigger anymore + rb.useGravity = true; playerCollider.isTrigger = false; + } } \ No newline at end of file diff --git a/Game/ProjectSettings/EditorSettings.asset b/Game/ProjectSettings/EditorSettings.asset index 5a91c95..b00a6a7 100644 --- a/Game/ProjectSettings/EditorSettings.asset +++ b/Game/ProjectSettings/EditorSettings.asset @@ -27,7 +27,7 @@ EditorSettings: m_UnlockBlockShaders: 0 m_PrefabModeAllowAutoSave: 1 m_EnterPlayModeOptionsEnabled: 1 - m_EnterPlayModeOptions: 0 + m_EnterPlayModeOptions: 3 m_GameObjectNamingDigits: 1 m_GameObjectNamingScheme: 0 m_AssetNamingUsesSpace: 1