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

How to fix CFrame rotation on a model from not working?

I'm using the code

local model = workspace.World

local cframe = model.PrimaryPart.CFrame
wait(3)

model:SetPrimaryPartCFrame(cframe * CFrame.Angles(0, math.rad(0), -90))

I set the Primary part of the model, and put the rotation value to -90, yet everything is rotating more than that.

2 comments

0

What rotation is your goal?

0

-90, instead its doing about -117 for some reason

1 answer

✓ Accepted answer

You are using math.rad on the wrong parameter. Remember, the parameters to CFrame.Angles are in radians.

model:SetPrimaryPartCFrame(cframe * CFrame.Angles(0, 0, math.rad(-90)))

3 comments

0

Thank you so much!

0

Glad I could help :D

0

remember to accept answers after someone answers your question pls redstone.

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