Editing CFrame not working properly

I’m trying to change the C0 CFrame of a Motor6d but the angles aren’t being applied to the right axis.

motor.C0 = CFrame.new(0,0,0.55) * CFrame.Angles(math.rad(45),math.rad(90),math.rad(0))

When I run it in game, the part is positioned wrong and the C0 Orientation turns out to be 0, 90, 45. I tried switching around the x axis to the z axis in the code to see if it works the way I want it to but obviously it didn’t. I can’t seem to manipulate the x axis orientation and it only allows me to manipulate the y and z axis.

1 Like

I got it working the way I want it to by manipulating the C1 CFrame instead, so at this point I’m just wondering if it’s a bug or if I’m doing something wrong.

1 Like

You’re doing something wrong.

You can’t modify the X asis because you used:

math.rad(0)

When the value is 0, you don’t use math.rad() because the game can’t convert nothing into radians, right?

That being said, your whole script should look like this:

motor.C0 = CFrame.new(0, 0, 0.55) * CFrame.Angles(math.rad(45), math.rad(90), 0)
1 Like

Try changing both of the values, .C0 and .C1.

1 Like

I tried that as well, still doesn’t work. 0 degrees to radians is just 0.

1 Like

Yeah, that’s what I ended up doing

No, 0 degrees to radians doesn’t work

image_2024-05-15_001444205

It doesn’t work in Roblox Studio, because you’re basically trying to convert nil to radians.
It’s obvious that 0 degrees converts to 0 radians

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.