Hey people! I've recently just figured out how to CFrame -- or move -- Models using MoveTo(), and it has helped me immensely. The thing is, now I want to learn how to rotate a model. It would be VERY helpful if anyone could teach me this skill, because I'm having trouble rotating the WHOLE Model instead of just its individual pieces. Thanks!
Yes, there is a way.
Arguments for the function:
function TransformModel(table objects, CFrame center, CFrame new_center[, bool recursive])
Code:
function TransformModel(objects, center, new, recurse) for _, object in pairs(objects) do if object:isA("BasePart") then object.CFrame = new:toWorldSpace(center:toObjectSpace(object.CFrame)) end if recurse then TransformModel(object:children(), center, new, true) end end end local Model = game.Workspace.ModelToRotate TransformModel(Model:children(), Model:GetModelCFrame(), Model:GetModelCFrame() * CFrame.new(0, math.rad(45), 0), true) -- Rotates the model 45*.