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

How do I add to a CFrame value without resetting it's position?

Asked by 9 years ago

I want to be able to use a for loop to progressively rotate a part using CFrame until it's at the desired orientation, but my knowledge on CFrame is extremely limited. I just simply need to know how to add rotational values to a part's current CFrame.

2 answers

Log in to vote
0
Answered by 9 years ago

CFrame.new = game.Workspace.Part.CFrame * CFrame.Angles(1, 0, 0)

This will make part stay in its position and rotate 1 (stud I think)

Ad
Log in to vote
0
Answered by
fdfxd 50
9 years ago

This oughta do the trick

Let's say the part you want to move is in workspace, and is called timmy

while true do
wait(1) -- Wouldn't want it to crash,would you? 
game.Workspace.timmy.CFrame = game.Workspace.timmy.CFrame + CFrame.Angles(1,0,0)
end

Answer this question