added basic enemy collision

still need to figure out how to make the jumping on heads work, but we need a jump for that lol
This commit is contained in:
slevy14
2023-04-26 16:05:43 -07:00
committed by Nicholas Novak
parent 3a20673b6f
commit 839a1710ec
2 changed files with 9 additions and 2 deletions

View File

@@ -166,4 +166,11 @@ public class PlayerBehavior : MonoBehaviour
grappleSurface = null;
}
}
void OnCollisionEnter2D(Collision2D collision) {
if (collision.gameObject.tag == "Enemy") {
this.stateController.SetDeathCanvasActive(true);
Destroy(this.gameObject);
}
}
}