# I just want to understand this code

I’m making a car game I’m watching a tutorial series on YouTube. I just want to understand this line of code I’m using for rotating wheel whhelBack_Right_Mesh.Rotate(wheelBackRight_Collider.rpm /60 × 360 × Time.deltaTime, 0,0)
It would be great if some just tell what 60 and 360 value represent.

The Rotate method takes a relative angle as parameter. Since the code is executed every frame we need to pass the angle we want to rotate each frame. The “rpm” property returns the current “revolutions per minute” of the wheel. So a value of “120” means the wheel is rotating 120 times per minute.

We divide by “60” seconds to get “rps” (revolutions per second). In our example that would be “2”.

Next as said we need an angle for Rotate. So multiplying by 360° since one revolution is 360°. So in our case we get 720 (==2 * 360) degree per second.

Finally since we do not execute this once per second but once every frame we multiply by deltaTime. At a framerate of abouf 60 fps deltaTime will be about 0.0166 (== 1/60). So the actual angle we rotate each frame is about 12° at a rpm value of 120.