Models not rotating

so I’m working on a tower of hell-type game, and it requires every other stage to be rotated 180 degrees.
so far, I have gotten the towers to randomly stack, but I can’t get every other tower to rotate 180 degrees.


as you can see, the bottom blue part should start just above the top orange one.

here is my script that should rotate every other stage:
image
function:


why is it not rotating? I’ve tried different ways to rotate, and none have worked so far. any suggestions?

note: there’s an invisible center part in every model to rotate

Is “stage” a single mesh? You cannot rotate entire models like that. Are you getting an error in output?

If it’s a model you want to rotate instead of a part do:

stage:SetPrimaryPartCFrame(stage.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(180), 0))

no, the function call is in a for loop that will create a stage, and asign it to the stage variable.

there’s no error output, it just doesn’t do anything.

Ill try that

OH! I think I understand whats going on:

You’re rotating the “invisible” part of the stage without moving the stage itself.

What I’d recommend is grouping the entire stage (If not done already) Then set the invisible part as the primary part, then call the

-- Keep in mind that "stage" needs to be the model and not the invisible part.
stage:SetPrimaryPartCFrame(stage.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(180), 0))
2 Likes

yeah this should work, because you need to have a primary part in order for it to work.

You can’t rotate models… Whay you should do is
for loop on all the model childs and set their rotation…

all of them have a primary part (the center part), it didn’t work.
image

Show me your updated code. I’m assuming that the “Center” part was rotating correctly but the rest of the model wasn’t

this is the function

this is where it is calledimage

Is “Stage” the “Center” part or is it the model?

stage is the model, and center is the stage’s primary part. I changed something, and got it to work once.

oop, found the issue. image
right before the ‘end’ at the bottom, I had a line that said
‘flipped = false’
this was supposed to go after the end.

thanks a ton for the help!