Rigging a sweeper to use it in unity

Hello Guys,

I’m working on a game. I use blender for modelling stuff and i use unity for the game parts.

So i have basics in animation, and i would like to know how can i rig a street sweeper?

So when it moves, the wheels rotate, and also the sweeper cleaner in front of the object (who cleans the street lol).

You can see in details below.


Also, i would like to give a faster rotation for the sweeper cleaner, than for the wheels.

Is it possible to do that? and how can i procede? i’m kind of lost for this.

Thanks a lot :eyebrowlift:

Welcome to BA!

Have you read this thread? https://blenderartists.org/forum/showthread.php?408509-Wheel-rotation-along-path

All is explained there - almost the same question as you posed. One thing to note: For wheels rotating on the ground you must work out the angular rotation in Radians (NOT degrees) per unit the wheel moves along. All scripted expression driver rotations are in Radians (there are 2 * pi Radians in a full circle) NOT degrees! So a wheel of 1 unit radius rotated 1 revolution per 2 * pi units it moves forward. 2 * pi is approx 6.284 units but you can use pi in scripted expressions, so you don’t need to remember this. It therefore follows that the driver for rotation of a wheel of 1 unit radius would simply be var where var is the forward motion. A wheel of 2 units radius would be var / 2 as the scripted expression. To make you sweeping head rotate faster you would use a scripted expression like this: var * 4 - this would rotate the sweeper head 4 times as fast as the 1 unit radius wheel, the minus sign switches the angle of rotation.

Don’t forget that you must check “Autorun Python Scripts” in User Prefs => File tab or scripted expressions will not work.

I am feeling generous just now (this is not always the case :eek:), so here is how to do it:


And here is a blend file:

wheel-test.blend (555 KB)

I may not be so generous if M. Hollande is tough and uncompromising on the Brits in the Brexit negotiations…

Cheers, Clock.

EDIT: Just noticed your name here it translates as shit10 in English, very funny…

Thanks a lot!

i will try it right away! :slight_smile: