Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

CFrame world axis/object axis problem?

Asked by
funyun 958 Moderation Voter
8 years ago

So, I want a part to rotate on its y-axis and also along the world's x-axis, as in the x-axis that parts always begin with. It would look something like

while wait() do
    script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(0, math.rad(4), 0) * something
end

And I'm not sure what that something is. If I did

script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(math.rad(12), math.rad(4), 0)

then that would make the part rotate on both its x and y-axes. Since it's constantly rotating on its y-axis, its x-axis is constantly changing. I need the part to rotate on two axes that do not change. How would I do that?

Answer this question