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

My rotation script isn't working how I want it?

Asked by
Relatch 550 Moderation Voter
9 years ago

Basically, this script works right. Except, when it gets to 180 it doesn't rotate anymore. I know why it stops at 180, but is it possible to continue the rotation?

while wait(0.01) do
    script.Parent.Rotation = script.Parent.Rotation + Vector3.new(0, -1, 0)
end

1 answer

Log in to vote
1
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

Don't use Rotation. Use CFrame instead.

while wait()do
    script.Parent.CFrame=script.Parent.CFrame*CFrame.Angles(0,math.pi/180,0)
end
0
there is something called spacebar! also, thanks! :P Relatch 550 — 9y
0
I tend to use as few characters as possible. It's a code golf habit. 1waffle1 2908 — 9y
0
Ah, I see. Relatch 550 — 9y
Ad

Answer this question