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

How do you make an object spin?

Asked by
xAtom_ik 574 Moderation Voter
11 years ago

Im just really confused. I don't know what makes it spin and how to script it. Can you help please?

3 answers

Log in to vote
2
Answered by
Damo999 182
11 years ago

Well it's pretty simple you can use a for loop if you want the part to spin a certain amount of times or a while loop which would make spin infinitely unless you call a break which would stop it there are other methods of spinning of objects but this is the way that i know how.

01--parts name will be brick
02 
03brick = script.Parent
04for i = 1,100 do
05brick.CFrame = brick.CFrame *CFrame.Angles(1,0,0)
06wait()
07end
08 
09--or a while loop
10 
11while true do
12wait()
13brick.CFrame = brick.CFrame *CFrame.Angles(1,0,0)
14end
0
Could you please tab your code. modFrost 130 — 11y
0
Sorry about that. Damo999 182 — 11y
Ad
Log in to vote
1
Answered by 11 years ago

Set Anchored to false on the part and then set the RotVelocity property to the desired direction you want the part to rotate.

Log in to vote
-1
Answered by 11 years ago
1while true do
2script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,0.1,0)
3wait(0.01)
4end

OR

1while true do
2script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0.05,0.05,0.05)
3wait()
4end

Answer this question