- Home /
Why does rigidbody rotate randomly on its own?
I don't know if this question is asking too much but I have a bike using sphere colliders on the wheels and a rigidbody for the parent object of the entire model.
My issue is that after the bike goes up any form of uneven terrain (ramps, small bumps, etc) it'll just, at random, rotate up to 90 degrees and stay there. Sometimes it'll rotate slightly (but not consistently the same angle) and eventually level back out. And it's always rotating forwards up until that 90 degrees mark.
One last thing, is that when it launches off the ramps it'll go up then start rotating forwards to face towards the ground. But again, its angle is always random. Does anyone have any idea WHY it's doing this?
Answer by meat5000 · Sep 12, 2013 at 03:26 PM
Swap the Spheres for wheel colliders and make sure the bike and the wheels are not able to collide with each other in the Collision Matrix
We tried using wheel colliders, but for a bike it was showing more problems than it was worth. And the bike body itself has no collider on it. Do you suggest using the wheel colliders over spheres for bikes? Cause it would just fall over and if we put four it feels like a car more than a bike. But I'll give it another shot if that's the preferred way to make a bike.
Check the model import tab for the bike and see if Generate Colliders is checked, per chance.
Yes it does. But I think we took the collider off for some reason. haha So, are wheel colliders the way to go for bikes?
Wheel colliders for wheels in general :) If you have generate colliders checked for the bike frame you will probably need to uncheck them in the collision matrix to make sure the frame isnt colliding with the wheels; otherwise the colliders will probably overlap and cause problems. Also, lowering the centre of gravity may help to stop the bike from tipping, just like when cars tend to roll in Unity.
Your answer
Follow this Question
Related Questions
Rigidbody goes wonky after collision 0 Answers
Lookat Direction by AddTorque? 0 Answers
Problem with rigidbody rotation 2 Answers
Rotating a MeshCollider 0 Answers
Have an object bounce off colliders instead of drift 2 Answers