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

How can I make a union rotate while keeping its original orientation?

Asked by 6 years ago

I'm trying to make a union spin, and it works but it doesn't keep it's original rotation, it resets back to 0,0,0. What can I do to fix that? This is my script so far.

local part = script.Parent
a = 0
repeat
part.Rotation = Vector3.new( 0, a, 0) 
wait(.01) 
a = a+3 
until nothing == 1 

1 answer

Log in to vote
0
Answered by
2eggnog 981 Moderation Voter
6 years ago

Instead of setting the Rotation to (0, a, 0) and adding 3 to a each time, start with the original rotation and add (0, 3, 0) each time.

local part = script.Parent
repeat
part.Rotation = part.Rotation + Vector3.new( 0, 3, 0) 
wait(.01) 
until nothing == 1 
Ad

Answer this question