dude7271
(Logan)
February 28, 2021, 7:46pm
#1
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:
function:
why is it not rotating? I’ve tried different ways to rotate, and none have worked so far. any suggestions?
dude7271
(Logan)
February 28, 2021, 7:51pm
#2
note: there’s an invisible center part in every model to rotate
polill00
(polill00)
February 28, 2021, 7:53pm
#3
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))
dude7271
(Logan)
February 28, 2021, 7:55pm
#4
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
polill00
(polill00)
February 28, 2021, 7:59pm
#5
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
maumau94
(Mau)
February 28, 2021, 8:00pm
#6
yeah this should work, because you need to have a primary part in order for it to work.
LOG1CEXE
(Kali_Linux)
February 28, 2021, 8:06pm
#7
You can’t rotate models… Whay you should do is
for loop on all the model childs and set their rotation…
dude7271
(Logan)
February 28, 2021, 8:06pm
#8
all of them have a primary part (the center part), it didn’t work.
polill00
(polill00)
February 28, 2021, 8:07pm
#9
Show me your updated code. I’m assuming that the “Center” part was rotating correctly but the rest of the model wasn’t
dude7271
(Logan)
February 28, 2021, 8:11pm
#10
this is the function
this is where it is called
polill00
(polill00)
February 28, 2021, 8:13pm
#11
Is “Stage” the “Center” part or is it the model?
dude7271
(Logan)
February 28, 2021, 8:15pm
#12
stage is the model, and center is the stage’s primary part. I changed something, and got it to work once.
dude7271
(Logan)
February 28, 2021, 8:18pm
#13
oop, found the issue.
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!