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

CFrame rotation help?

I have a part with a position and rotation of (0,0,0). I want the part to be at the position (30,30,30) and have a rotation of (25,80,30). How would I go about writing this using CFrame.new()?

Note: I cannot use the position and rotation values of the part I have to use the CFrame.

1 answer

✓ Accepted answer

CFrame.new(30,30,30) * CFrame.Angles(math.rad(25),math.rad(80),math.rad(30))

Extra Stuffs:

Alright, but it might be a little difficult. Imagine the center of workspace is CFrame.new(0,0,0)*CFrame.Angles(0,0,0)

If you changed that to CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(45),0) you end up changing that center CFrame, and rotating it 45 degrees.

Now, if you do CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(45),0)*CFrame.new(0,0,10) the final CFrame will move away from 0,0,0 at a 45 degree angle.

This would allow you to do some really neat things, like CFraming entire vehicles and rotating them with ease.

2 comments

0

I'd like to know the different ways. Would you mind telling me some?

0

I just edited my answer. I hope you can use it in some way. .3.

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