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)))

2 comments
game.Workspace["Red Couch"]:setPrimaryPartCFrame(game.Workspace["Red Couch"].Base.CFrame*CFrame.Angles(math.rad(-0), math.rad(22.5), math.rad(0)))
That does the same thing, how would I fix that?