Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to keep rotation in a CFrame?

When i use a CFrame, it always comes back into a certain rotation, even if i use:

script.Parent.CFrame = CFrame.new(script.Parent.Position) * CFrame.Angles(script.Parent.Rotation)

Can anyone help me / tell me why this does not work?

3 answers

local vect = Vector3.new(0,0,0)
script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(vect)

Below will spin the part around in circles,

script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(0,math.rad(2),0)

You don't use

script.Parent.CFrame = script.Parent.CFrame.new(part.Position) * CFrame.new() 

You use

script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(script.Parent.Orientation)

If you want it to rotate, you would use

while true do
	script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,math.rad(1),0)
end

And that should do it.

This discussion is preserved as it was. New answers, comments, and votes are closed.