Unity 2d Collision detection player status
The code below is used in a 2d game, I was wondering how to make it so certain object do different things instead of just killing my player. If I have an object ground i want it to kill the player like the code below, but what if I had more objects that I wanted them to do other things than just kill the player? Any help or suggestions?
void OnCollisionEnter2D () {
myRigidBody.velocity = Vector2.zero;// stops player
isDead = true;
GameControl.instance.PlayerDied ();
Timer.instance.StopTimer ();
}
Comment