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

I can't rotate a part with CFrame?

I am trying to make a Part rotate with CFrame but i can't and i don't know why.

Here is the script:


wait(3)

local block = game.Workspace.Rotating 

local newCFrame = CFrame.Angles(0, math.rad(45), 0)

block.CFrame = newCFrame

--Rotating is the name of my part.

Please tell me what i am doing wrong.

5 comments

0

block.CFrame = block.CFrame * CFrame.Angles(0, math.rad(45), 0)

0

Thank you very much!

0

pls use code block.

0

you cant in a comment

0

@AradIsHere for the question...

1 answer

✓ Accepted answer

when creating a CFrame or Vector3 you need to add .new to make it existing Also when rotating you use Vector3 not CFrame.

wait(3)

local block = game.Workspace.Rotating 

local newVector = Vector3.new(0, math.rad(45), 0)

block.CFrame = newVector

--Rotating is the name of my part.

1 comment

0

oh already was solved oof

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