Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I rotate a whole model?(UNSANSWERED)

I don't know any methods to do this, could someone help me out with this?

1 comment

0

I'll edit one sec.

3 answers

✓ Accepted answer

Credit to Anaminus I just annotated(label) it

Any questions comment below

local degreesX=0
local degreesY=90
local degreesZ=0
local model = workspace.Model

function RelativeTransform(center,objects,trans) -- (cframe, table, function)
local new = trans(center) 
for _,object in pairs(objects) do -- get all objects and dose stuff to them
object.CFrame = new:toWorldSpace(center:toObjectSpace(object.CFrame)) -- Changes the position
end
end

RelativeTransform(
model:GetModelCFrame(), -- use the model's center
model:GetChildren(), -- use the model's children
function(center) -- rotate the center by 90 degrees
return center * CFrame.Angles(math.rad(degreesX),math.rad(degreesY),math.rad(degreesZ))
end)

Here is forum that might help though explaining might be more self explanatory as soon as you see the post. Post

1 comment

1

Please explain your Answer within your Answer. Do not just link to another source.

ok, first off, you dont need to go to script to just rotate a model. just group it, so it is a model, then rotate it. Dont make things so complex thinking that your a scripter. Your making it harder and longer just to script a rotating model.

This discussion is preserved as it was. New answers, comments, and votes are closed.