Meat_Make
(Meat Make)
June 1, 2023, 11:54pm
#1
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:
What could be wrong? Doing += to any other axis works fine
You’re supposed to be doing it with Orientation
, not Rotation
.
1 Like
Meat_Make
(Meat Make)
June 1, 2023, 11:58pm
#3
ohhhh, thanks now it works! But now im confused whats rotation for then?
I believe it’s a deprecated version of LinearAngularVelocity.
1 Like
Doomcolp
(dxxmed)
June 2, 2023, 12:01am
#5
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
Let’s take a regular part with no initial rotation. Here, I’m highlighting the axes of rotation (red = X, green = Y, blue = Z);
[image]
In the Euler angles system that Roblox uses, the axes of rotation will rotate along with the part. So, if we apply a 45 degree rotation on the X axis, notice that the Y and Z axes are also rotated:
[image]
If we then apply a 90 degree rotation on the Y axis, the axes will be rotated again;
[image]
Now, let’s try that again, but we’ll do the Y axis first…
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
1 Like
system
(system)
Closed
June 16, 2023, 12:20am
#8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.