Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I rotate a whole model?(UNSANSWERED)

Asked by 10 years ago

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

0
I'll edit one sec. HexC3D 830 — 10y

3 answers

Log in to vote
1
Answered by
RM0d 305 Moderation Voter
10 years ago

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)
Ad
Log in to vote
0
Answered by
HexC3D 830 Moderation Voter
10 years ago

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

1
Please explain your Answer *within* your Answer. Do not just link to another source. adark 5487 — 10y
Log in to vote
-1
Answered by 9 years ago

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.

Answer this question