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); + } + } }