- Home /
Moing Center Of Mass makes my car go crazy and fly around!
I've been having this problem for a while. Even setting rigidbody.centerOfMass = Vector3(0,0,0) makes the car go crazy. Any ideas?
Answer by efge · Mar 13, 2011 at 10:52 PM
Put anything related to physics (rigidbodies, forces etc.) in the function FixedUpdate().
(just a guess)
Thank you so much. This is such a big duh! But I'm so happy now that it really doesn't matter. Thank you for your genius. Now my little car is not flipping over like a London double-decker on two wheels. lol.
Answer by Statement · Mar 13, 2011 at 10:56 PM
IIRC I had similar problems as well when setting the center or changing inertia. I think after you set the values, disable and then enable the object to see if it works better. I am not sure, it's been a few years since I did this but I am pretty confident it was what did the trick for us.
I think this would also help as I've seen this done in Wheel Collider Scripts and wasn't sure why. But the Above solution worked.