How to make a spinning part?

Hello! Im trying to make a spinning part that rotates in the Y axis but I’m running into an issue:

As shown in the video above the part rotates and then stutters when it reaches a certain point…

This is my code:
image
What could be wrong? Doing += to any other axis works fine

You’re supposed to be doing it with Orientation, not Rotation.

1 Like

ohhhh, thanks now it works! But now im confused whats rotation for then?

I believe it’s a deprecated version of LinearAngularVelocity.

1 Like

Here’s a DevForum post that I believe should help you understand the difference between the Rotation property versus the Orientation property:

Edit: Check the marked answer

1 Like

Rotation uses Euler Angles and Orientation uses Yaw, Pitch, and Roll

What you should do is reset the rotation if it goes over 360

if Part.Rotation.Y > 360 then
    Part.Rotation = Vector3.new(Part.Rotation.X, 0, Part.Rotation.Y)
else
    Part.Rotation += Vector3.new(0, -1, 0)
end
2 Likes
local Part = script.Parent

local PartSpeed = 0.05 -- Speed of the spin (adjustable)

while task.wait() do
    Part.CFrame = Part.CFrame * CFrame.Angles(0, PartSpeed ,0) -- Angle it rotates (adjustable)
end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.