# Car Rigging Wheels Problem

#1

Hello,

I’m new to rigging and I’m having an issue with my car rig, sorry if this is the wrong forum but there were no other forum about rigging

So, I try to automate my wheels so they can rotate when my car goes forward/backward, I did this with a driven key in that way :
root at 0 in Z = rotate at 0 and root at wheelHeight*pi in Z = rotate at 360 and set a post/pre infinity cycle in the graph editor, this works well if my car goes straight forward in Z but if I rotate my root (which controls the whole car mesh) the wheels turn slower, ok I understand why but I can’t figure a way to solve this.

I tried to set another driven key in translate X (added to the one in Z) but then it doesn’t work in every directions, I also tried to create an expression like :
root.translateZ = wheel.rotateX * A where A is a number I calculated but it as the same effect as the driven key
I have my ctrl_master which controls everything that allows me to rotate the car then make it go forward in every direction but again if I want to rotate the car on itself I can’t because of the offset between the root and the master (the car will rotate according to the master pivot)

I there any way to do this ? Every tutorial I could find does pretty much the same thing as I did with the driven keys but they never show what happens if they rotate their car

Thanks in advance and sorry for my english if I made some mistakes

#2

You have to bake.

You need to step through frame by frame, and get the vector direction that the wheel is traveling in. You take the length of that vector and use that with the wheel radius to determine how far the wheel should turn.

The other part of it is that you can blend off how much the wheel turns by doing the dot product of the angle of the wheel vs the direction traveled. If the dot product is 0, then it means the wheel is facing sideways and shouldn’t spin.

It’s a bit of math to sort out but it’s a fun project. Good luck!