New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Still have questions? Join our Discord server and get real time help.
Log in to vote

How to keep rotation in a CFrame?

Asked by
RubenKan 3570 Moderation Voter Administrator Community Moderator
6 years ago

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

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

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

3 answers

Log in to vote
Answered by 6 years ago
local vect =,0,0)
script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(vect)
Log in to vote
Answered by
modFrost 130
6 years ago

Below will spin the part around in circles,

script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(0,math.rad(2),0)
Log in to vote
Answered by 10 months ago

You don't use

script.Parent.CFrame = * 

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 *,math.rad(1),0)

And that should do it.

Answer this question