From 538e5e8af216b532ff8cb0c6a062f7142ab15706 Mon Sep 17 00:00:00 2001 From: orsolya-st Date: Sun, 7 Jun 2026 10:01:22 +0200 Subject: [PATCH] start scene bug fix --- Game/Assets/Scripts/DropletMovement.cs | 12 +----------- Game/Assets/Scripts/FalldownScene.cs | 4 ++++ Game/Assets/Scripts/HoleDeath.cs | 4 ++++ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Game/Assets/Scripts/DropletMovement.cs b/Game/Assets/Scripts/DropletMovement.cs index 8fae26d..9f275f9 100644 --- a/Game/Assets/Scripts/DropletMovement.cs +++ b/Game/Assets/Scripts/DropletMovement.cs @@ -65,16 +65,6 @@ public class DropletMovement : MonoBehaviour rb.linearVelocity = new Vector2(rb.linearVelocity.x, jumpingPower); } - //Jump animation - - // if (rb.linearVelocityY < fallingAnimationVelocityThreshold && !isGrounded) - // { - // animator.SetBool("Falling", true); - // } else - // { - // animator.SetBool("Falling", false); - // } - //Walk animation if (movement.x > 0) { animator.SetBool("WalkingRight", true); @@ -125,7 +115,7 @@ public class DropletMovement : MonoBehaviour if (other.CompareTag("Hole")) { SceneManager.LoadScene(2, LoadSceneMode.Single); - Destroy(gameObject); + //Destroy(gameObject); Debug.Log("Fell in hole!"); } diff --git a/Game/Assets/Scripts/FalldownScene.cs b/Game/Assets/Scripts/FalldownScene.cs index b5a4584..9f6ae1f 100644 --- a/Game/Assets/Scripts/FalldownScene.cs +++ b/Game/Assets/Scripts/FalldownScene.cs @@ -2,8 +2,12 @@ using UnityEngine; public class FalldownScene : MonoBehaviour { + public GameObject targetObject; + void Awake() { + targetObject = GameObject.FindGameObjectWithTag("Player"); + Destroy(targetObject); // This tells Unity NOT to destroy this object when loading a new scene DontDestroyOnLoad(gameObject); } diff --git a/Game/Assets/Scripts/HoleDeath.cs b/Game/Assets/Scripts/HoleDeath.cs index 6e57ac5..ac22597 100644 --- a/Game/Assets/Scripts/HoleDeath.cs +++ b/Game/Assets/Scripts/HoleDeath.cs @@ -2,8 +2,12 @@ using UnityEngine; public class HoleDeath : MonoBehaviour { + public GameObject targetObject; + void Awake() { + targetObject = GameObject.FindGameObjectWithTag("Player"); + Destroy(targetObject); // This tells Unity NOT to destroy this object when loading a new scene DontDestroyOnLoad(gameObject); }