Hi,
I’m trying to detach an object from his parent when it’s not colliding anymore (it’s a rigidbody on a platform)
function OnCollisionStay (TheCollision : Collision) {
if(TheCollision.gameObject.tag == "Plateform"){
Debug.Log("NNNNNNNOOOOOOOOOO");
transform.parent = TheCollision.transform ;
}
}
function OnCollisionExit (TheCollision : Collision) {
if(TheCollision.gameObject.tag == "Plateform"){
Debug.Log("SSSSSSSSSSSSUUUUUU");
transform.parent = null;
}
}
Actually , the console is not even displaying SSSSUUUU when it’s not colliding anymore , i’ve tried with OnCollisionEnter instead of OnCollisionStay , but it doesn’t work at all and the object does not become the child of the platform when it collides with it
What can I do ???
Thanks for reading