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

How would I make a model rotate around a part?

What I mean is how would I rotate a model as a whole while maintaining the relativity to everything else in the model, like in studio? I think you have to set the primary part and you can use moveto to move things like that, but how would you do rotation? I tried this:

for i = 1,100 do
for i,v in pairs (game.Workspace.Rotationmodel:GetChildren()) do
v.Part.Rotation.Y = v.Part.Rotation.Y + 1
end
 end

1 answer

✓ Accepted answer

Forget MoveTo, use SetPrimaryPartCFrame.

local RotationModel = workspace.RotationModel

for i = 1,100 do
	RotationModel:SetPrimaryPartCFrame(RotationModel.CFrame * CFrame.Angles(0, 1, 0)) 
end

3 comments

0

Thanks

0

CFrame is not a valid member of Model Is the error I am getting

1

Nevermind, I fixed it, you forgot to put PrimaryPart after the RotationModel in the parentheses.

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