From 54b6c3115c8a5aa617c69df2cc15a581d3cd0566 Mon Sep 17 00:00:00 2001 From: SpoodyTheOne Date: Sun, 4 Feb 2024 09:12:58 +0100 Subject: [PATCH] fuck --- Assets/Scripts/Player/PlayerMovement.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Assets/Scripts/Player/PlayerMovement.cs b/Assets/Scripts/Player/PlayerMovement.cs index 1ca47fc..22d08b1 100644 --- a/Assets/Scripts/Player/PlayerMovement.cs +++ b/Assets/Scripts/Player/PlayerMovement.cs @@ -80,4 +80,15 @@ public class PlayerMovement : MonoBehaviour } } + + void OnCollisionStay2D(Collision2D collision) + { + Debug.Log("Hit other " + collision.otherCollider.gameObject.name); + Debug.Log("Hit other " + collision.collider.gameObject.name); + if (collision.collider.gameObject.CompareTag("Enemy")) + { // Other object is an enemy + Debug.Log("Hit enememenemy"); + hp.TakeDamage(1f); + } + } }