Problem with speed and angular speed : bolt and nut system

I have design a bolt (M16 and pitch = 2 mm) and a nut and I want the bolt to screw in the nut. The problem is that I don’t know what are the units of speed and angular speed. I saw that it could be m/s and rad/s but it doesn’t work because when I use the formula : angular speed (RPM) = feed rate (mm/min) / pitch (mm), with a feed rate of 1 (unity unit) I get an angular speed of 3142 rad/s, and it’s impossible…
You will find in attachment a part of the code.

Thank you for your answers

Victoire

3219931--246789--Bolt controler.PNG
3219931--246790--code2.PNG
3219931--246795--Code.PNG
3219931--246789--Bolt controler.PNG
3219931--246795--Code.PNG

atleast in that transform rotate line you have comma there… probably want *

Sorry but it changes nothing…
Thank you

mgear, are you referring to the Transform.Translate command? It’s suppose to be that way.

Victoireb, can you elaborate on your issue a bit more? What is the bolt and nut currently doing? How is it different from what you want it to do? Usually if you can’t calculate the values you’re looking for you wind up playing a game of “hot and cold” while you adjust until the value is what you want. I’d suggest starting with a very low value for turnSpeed so you can see it turning, and then adjust speed until the threads no longer appear to move, like a real bolt that’s threading. With those values in hand, you now have a ratio and you can just scale.

If you want to do the hard calculations, remember that unity’s default spacial unit is understood to be meters. You will probably want to make sure your model is scaled to suit. Also the Transform.Rotate command uses Degrees instead of Radians, so make sure you’re converting to that.

Use forum code tags next time. Screenshots of code are simply not usable, and rather silly.