How to rotate an entire model?

Hey guys, so I’ve been trying to figure out how I’m able to rotate an entire model.

Here’s the code I’m using:

piece:SetPrimaryPartCFrame(other_part:GetPrimaryPartCFrame() * CFrame.Angles(math.rad(90),0,0))

It rotates the PrimaryPart, but the other part in the model’s orientation unfortunately remains the same. For what I’m doing, I pretty much need to keep using the Get/SetPrimaryPartCFrame method, otherwise I might run into some bugs.

Help appreciated! Thanks!

16 Likes

Are the other parts welded to the Primary Part using Welds (not WeldConstraints)?

1 Like

That was a fast reply!

Actually, all the parts in the model are anchored, using no welds or constraints.

2 Likes

Odd. Do you have a quick repro file I could use to test?

1 Like

I might, but I would ask that if possible could you clarify what that is? xd

2 Likes

A place file (could be just a baseplate where it occurs) that I can use to repro, or reproduce, the issue to try to fix it.

1 Like

I’m actually really stupid. I for some reason thought I put in the right axis to rotate, but I guess I didn’t visualize it correctly, as I changed the axis just to test real quick and that did the trick…

Well, your help is still much appreciated!

9 Likes

If you haven’t solved it yet, this script should work properly. Just make sure everything is anchored and remember to set a primary part.

while true do
script.Parent:SetPrimaryPartCFrame(script.Parent:GetPrimaryPartCFrame()*CFrame.fromEulerAnglesXYZ(0,.05,0))
wait()
end
42 Likes

Oh, no problem, I’m glad you figured it out!

and thank you for not just saying “I figured it out” and closing the thread like a lot of people on scripting helpers do (no offence to anyone there)

30 Likes