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

How do you make an object rotate to a certain angle regardless of its current rotation?

Asked by 3 years ago

So I have an object, let's say it's current rotation is maybe CFrame.Angles(0, math.rad(67.5), 0). How do you rotate an object so that it would rotate to an angle (such as CFrame.Angles(0, 0, 0) regardless of it's current rotation? I have no idea where to start with this. Because of this, I can't post any code.

1 answer

Log in to vote
0
Answered by 3 years ago

Wouldn't this work?

local Part = game.Workspace.Part --Whatever part your using
local OriginalPosition = Part.Position --The original position

Part.CFrame = CFrame.Angles(0,0,0) --Set the CFrame angles to 0,0,0
wait() --Just in case
Part.CFrame = CFrame.new(OriginalPosition) --I dont know if this is required but it worked for me

Sorry in advance if this doesn't work, I'm new to scripting.

Ad

Answer this question