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

CFrame working strange, can someone tell how to use this correctly?

I can't understand, why my player goes at random position of map when I'm using script.Parent.HumanoidRootPart.CFrame = CFrame.new(0, -90, 90). Also I used script.Parent.HumanoidRootPart.CFrame *= CFrame.Angles(0, math.rad(-90), math.rad(90)) but that rotates player from his existing orietation. not creating new. So can someone tell how to rotate player with new orientation?

1 answer

✓ Accepted answer

Set CFrame to a new CFrame consisting of only HRP's position, no rotation. Then apply the rotation through CFrame.Angles

script.Parent.HumanoidRootPart.CFrame = CFrame.new(script.Parent.HumanoidRootPart.Position) * CFrame.Angles(0, math.rad(-90), math.rad(90))

1 comment

0

tysm, that helped me alot.

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