void OnCollisionEnter()
{
// I need to know whether this method running on a gameObject which collider other
// instead of being collided by other.
}
void OnCollisionEnter()
{
// I need to know whether this method running on a gameObject which collider other
// instead of being collided by other.
}
void OnCollisionEnter() used to detect other gameobjects:
void OnCollisionEnter(Collision other)
{
if(other.gamobject.tag == “Enemy”)
{
do sum thing
}
}
//note “Enemy” is the tag for other game object taged in unity mor info see unity tags.