Heyo, I wan't to set a model rotation, this works kinda works but it adds on to the rotation. So how would I set it and not just add on to the rotation amount?
I'm sorry if I'm not making sense I just don't know how to explain it.... Basically I want the rotation = what I set and not the original rotation+what I set
function rotatemodel(model,center,rotation) for i,v in ipairs(model:GetChildren()) do if v:IsA("BasePart") then v.CFrame=((CFrame.new(center)*rotation)*CFrame.new((v.Position-center)))*(v.CFrame-v.Position) --elseif v:IsA("Model")or v:IsA("Folder") then --rotatemodel(model,center,rotation) end end end local tabel = game.Workspace["Red Couch"] rotatemodel(tabel,tabel.Base.Position,CFrame.Angles(math.rad(-0), math.rad(22.5), math.rad(0)))
You can put an invisible part in the very middle of your model, and set the PrimaryPart to that part. After you can just modify that part with :setPrimaryPartCFrame
and it will mess with the whole model. Basically you can rotate, and position the whole model through that one part. :)
Hope this helped!
Sincerely, jmanrock123
`local x, y, z = game.Workspace["Red Couch"].Base.CFrame:toEulerAnglesXYZ() game.Workspace["Red Couch"]:setPrimaryPartCFrame(game.Workspace["Red Couch"].Base.CFrameCFrame.Angles(x-1, y-1, z-1)*CFrame.Angles(math.rad(-0), math.rad(22.5), math.rad(0)))
`