- Home /
Making a realistic tire/wheel?
This might be kind of tricky to explain but I'll try my best.
My character is basically just a wheel, a single wheel (looks like a car tire actually) that is always standing up. I want him to do the usual when movement keys are pressed; go forward, backward, left and right etc. But I want his movements to mimic those of a wheel as if it was rolling around in different directions.
The physics of this are kind of hard to nail down and so far nothing I've done has really looked right. I kind of want him to sort of "tilt" to one side when turning, when backing up I want the wheel to just go in reverse instead of just immediately turning around, and some way to keep it from falling over when ever sharp turns are made. You know how wheels behave I'm sure.
Can anyone point me in the right direction to something that might help me get off the ground with controls like these?
Thanks a lot.
Answer by Borgo · Feb 02, 2011 at 07:59 PM
Well, we have a lot of questions here :)
Things that can help you:
Physics materials
This can help you if you are using rigidbodies. The Physics materials determines the friction and bouncing of your object.
Freeze rotation
This will freeze the rotation of your rigidbody, this way, your wheel will not fall aside.
Math
I don't see another way than this to rotation (rolling) the wheel: calculates the velocity and diameter of your object to determines the rolling rotation. This way, you will need just to apply a force to your object. I guess the racing tutorial uses this calculation.
Thanks a lot! That will help, didn't know about freeze rotation.
Answer by e-bonneville · Feb 02, 2011 at 08:03 PM
Have you tried working with wheel colliders? They may help somewhat. You'll have to play around with them a lot to get it to work, but at least you don't have to script the physics yourself - that can get a bit hairy.
$$anonymous$$an, I'm so dumb. Wheel colliders, of course. Thanks for pointing those out to me, I never really noticed it before.