- Home /
Rigidbody parenting collisions question (katamari effect).
Ok, I used this simple code in a rigidbody object and the object tagged as "player" is another rigidbody (sphere) that I can roll away.
var pegou = false; function OnTriggerStay (other : Collider) { if(other.gameObject.tag == "mao"){ pegou = true; } } function Update() { if (pegou){
heldObject = gameObject;
heldObject.transform.parent = gameObject.FindWithTag("Player").transform;
heldObject.GetComponent(Rigidbody).isKinematic = true;
}
}
it works, the other object is parented the way it needs but I want the other rigidbody becomes part of the first object (father) at all, it means collide with the ground and change the way the fatherwalk. Is there a way??
Answer by Mike 3 · Dec 25, 2010 at 05:07 AM
Remove the rigidbody from the new child entirely, its collider should work correctly with the ball's rigidbody
Thank you very much for this Christmas
you made a very noob guy happy!
You're welcome, I hope you at least put it under the tree first though! :D
Your answer
Follow this Question
Related Questions
Parented Rigidbody Collisions 0 Answers
Child calling parent's OnTriggerEnter when no Rigidbody is attached to child 1 Answer
Parent rigidbody using its childrens colliders. Should it work or am I stupid? 2 Answers
Weird bounching with Rigidbodies (2D) 0 Answers
Is there a rigidbody character controller 3rd person that can handel stairs (steps)? 1 Answer