- Home /
Rigidbody parent affecting rigid body of a child
Hi.
I have a spaceship that flies around using a rigid body. When a player (which also have a rigid body) walks into the ship, the ship becomes a parent of that player. This is because I need to be able to rotate and move the ship so that the player rotates with it seamlessly. The issue is following:
If I move the ship's transform, everything works as expected (the player is perfectly moving with the ship). However, when I move the ship by adding force to it's rigid body, the player starts lagging behind the ship and eventually falls out.
How can this be fixed? I am not sure what is even going on. I guess the parents rigid body translates some of it's velocity to it's children rigid bodies???
Any help appreciated Thanks Jacklin
Answer by recon472 · Jan 06, 2015 at 09:05 AM
So in the end I just made a static copy of the ship where the character controller / rigid body moves and in the actual moving ship theres only a camera and the animated character. and I am syncing localPosition between the two objects. That works perfectly...
Answer by Inok · Dec 30, 2014 at 01:33 PM
I can give you better solution for interaction hero and ship: You not need to make player child of ship, instead just make local relative to ship's floor gravity. When i say "local gravity" i mean add force to Hero Rigidbody. But disable global gravity in project settings when need to use local ship gravity. This concept not perfect and needs to be improved by you if you accept it.
thanks. well I'll give it a try, although I see ton of new problems this could have. I'll get back to you
well I can't get any better results. the player is still being pushed around no matter what