Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

CFrame rotation help?

Asked by
xApRix 25
8 years ago

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

Log in to vote
0
Answered by
neff111 20
8 years ago

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.

0
I'd like to know the different ways. Would you mind telling me some? xApRix 25 — 8y
0
I just edited my answer. I hope you can use it in some way. .3. neff111 20 — 8y
Ad

Answer this question