I attached this code to a child of some GameObject, what the code is doing is just checking if the collision happens between child and parent (that is what it should do, but it doesnt work ??).
private void OnTriggerStay(Collider other)
{
if( other.gameObject.GetInstanceID() == transform.parent.gameObject.GetInstanceID())
{
Debug.Log("other gameobject instance ID: " + other.gameObject.GetInstanceID());
}
else if (other.gameObject.GetInstanceID() != transform.parent.gameObject.GetInstanceID())
{
Debug.Log("this gamobject instance ID: " + transform.parent.gameObject.GetInstanceID());
}
}
