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:
1 | for i = 1 , 100 do |
2 | for i,v in pairs (game.Workspace.Rotationmodel:GetChildren()) do |
3 | v.Part.Rotation.Y = v.Part.Rotation.Y + 1 |
4 | end |
5 | end |
Forget MoveTo
, use SetPrimaryPartCFrame
.
1 | local RotationModel = workspace.RotationModel |
2 |
3 | for i = 1 , 100 do |
4 | RotationModel:SetPrimaryPartCFrame(RotationModel.CFrame * CFrame.Angles( 0 , 1 , 0 )) |
5 | end |