hi, sorry for my bad English, I’m trying to make a platform game 2d, the player has two objects. The parent object contains two Colliders2d (box, circle), but I don’t know how to recall the Collider by name on “onCollisionEnter” please help me!! thanks.
Hi,
If i understand, you want the collider name;
Try this:
private void OnCollisionEnter2D(Collision2D collision)
{
var collider = collision.GetContact(0).collider;
var otherCollider = collision.GetContact(0).otherCollider;
}
Tell me if you have any problems.
You mean OnCollisionEnter()
, right?