Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can i make a Motor6d rotate in a loop?

im experimenting motor6d for cars and use them for rotating wheels, but how do i make a motor6d rotate in a loop?

2 answers

You make a Motor6D rotate by setting the MaxVelocity property to something non-zero, and giving the motor a DesiredAngle to seek. It will spin until CurrentAngle reaches DesiredAngle. There should be no code loops setting the C0, C1, or Transform properties directly for the the purposes of making a Motor6D turn, as this completely defeats the ability for the Roblox engine to interpolation the motion smoothly on all clients. There are times when it's perfectly valid and necessary to manipulate the CFrames of a Motor6D, but for simply turning like a motor, it's made to do that without needing scripting updating it every frame.

2 comments

0

Is it possible for the motor to spin forever until the cars throttle goes to 0?

0

Yes, you can set the DesiredAngle very large, so large it would take years to reach, and considering a Roblox server stays up for a few days at most, that's as good as forever.

This discussion is preserved as it was. New answers, comments, and votes are closed.