bottom border --> destroy object

This commit is contained in:
orsolya-st
2026-06-06 10:30:04 +02:00
parent 533589597a
commit 951b815f5c
10 changed files with 243 additions and 7 deletions
+7 -4
View File
@@ -75,11 +75,14 @@ public class DropletMovement : MonoBehaviour
rb.linearVelocity = new Vector2(movement.x * moveSpeed, rb.linearVelocity.y);
}
/*void OnCollisionEnter2D(Collision2D collision)
private void OnTriggerEnter2D(Collider2D other)
{
//if (collision.collider.GetType() == typeof(BoxCollider) && collision.collider.GetComponent == ) {
Destroy(gameObject); //base: destroys the game object
}*/
if (other.CompareTag("Border"))
{
Destroy(gameObject); //for now it destroys the droplet
Debug.Log("Droplet dropped down, animation, game end!");
}
}
private IEnumerator Dash()
{