How do I (In Javascript) check the other collider’s name?
2 Answers
2function OnCollisionEnter(other : Collision)
{
print(other.collider.name);
}
function OnCollisionEnter (collision : Collision) {
print(collision.gameObject.name);
}
I’m assuming you want the name of the gameobject the collider is attached to.