So basically, I want a part’s orientation switch to 90 degrees using CFrames, so I did this.
{Handle.CFrame = Handle.CFrame * CFrame.Angles(0,math.rad(90),0)}
But what if I wanna go back to it’s original orientation? I tried this:
{Handle.CFrame = Handle.CFrame * CFrame.Angles(0,0,0)}
But the part isn’t turning.
Why not CFrame.Angles(0, -90, 0)
?
That just teleported the part to the origin of the world.
I’ve made sure it’s CFrame.Angles()
and NOT CFrame.new()
.
I believe @Pokemoncraft5290 meant
Handle.CFrame = Handle.CFrame * CFrame.Angles(0,-math.rad(90),0)
Edit: but also, if you want it to go back to its original orientation… why not just save its original orientation in a variable before you change it? Then the problem is easy.
3 Likes
Good question, my model needs CFrame in order to move other connected parts. Also this worked, except I have to add math.rad(-90)
because it needs radians in order to orient it correctly. Thanks! @Pokemoncraft5290
Right, I’m saying:
local original = Handle.CFrame
-- change it
Handle.CFrame = Handle.CFrame * CFrame.new(0, math.rad(90), 0)
-- reset it
Handle.CFrame = original
Yeah, but I prefer something dependant on roration, not regardless of it’s rotation/Cframe.