Hey guys. I have a question that needs to be answered: How do you rotate a model? I have tried the following script and put it inside a model, but it only MOVES the model, not ROTATE it.
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 = script.Parent wait(3) for i = 1,1 do TransformModel(Model:children(), Model:GetModelCFrame(), Model:GetModelCFrame() *CFrame.new(0,math.rad(-250),0), true) wait(0.01) end
If anyone can help me, that would be AWESOME.
while true do script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,0.1,0) wait(0.01) end