I’m trying to create a script to do that when the player collides with a trigger again starting position of the game, but I’m not able to detect the collision.
Collider and Trigger result in OnTriggerEnter, not OnCollisionEnter.
you cant detect if a rigidbody is colliding you have to make a 2DCollider for the player and the object you want to collide with
for the code you could tag the Objects like give the Player the Player tag and the object lets say ground then in the playerController Script
write soemthign like this
void OnTriggerEnter2D (Collider other)
{
if (other.tag == "ground")
{
do soemthign
}
}
hope this solve it ![]()