Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i make Models rotate/turn with a script?

I tried using the Rotation property, until i remember Model's don't have a Rotation property, so now i need help?

2 answers

You are correct on that note. To Rotate all children of a model, I'd recommend using the GetChildren method.

a = game.Workspace.Model
num = 0
repeat
for i,v in pairs(a) do
	v.Rotation = v.Rotation + .1
end
num = num+1
wait()
until num == 10

The above script will move all the parts in a circular motion until I call it to stop.

A way I commonly use involves Model:SetIdentityOrientation() and Model:ResetOrientationToIdentity().

First, set the model's PrimaryPart to something inside the model (a Part will work) In this case, I will use part P.

Now we call Model:SetIdentityOrientation().

Now, I set P's Rotation value to a rotation I choose. Note that the model will rotate the other way.

Finally, we call Model:ResetOrientationToIdentity() to rotate the model.

From here you can reset the PrimaryPart value if you wish, if so you should call the Destroy() method on part P.

This discussion is preserved as it was. New answers, comments, and votes are closed.