# Help with CFrame.Angles

my problems is with a BodyGyro when I set its CFrame like this BodyGyro.CFrame = CFrame.Angles(math.rad(40),math.rad(40),0) it some how changes the z axis when the z axis needs to be 0 and I’m not changing the z axis/rotation from 0 what I’ve tried is setting the x and y axis/rotation separately and it works fine but when I set them together it changes the z axis/rotation to

Try setting the `.MaxTorque` property to `Vector3.new(100, 100, 0)` to prevent it from moving the Z axis.

Take into account that each other axis’s directions change with each rotation
here’s an example of what I mean:
https://gyazo.com/1cc804f22dbeefbdd4d637ef2af1bb99

As you can see, the y axis rotation arrow changes from rotation to the sides to almost upward/downward rotation.

so, you will have to calculate how to rotate them correctly in order to get them to do the rotation you want.

(dont know if i understood the problem correctly or not)

yes I know x,y,z change direction relative to rotation the thing what mine is doing is changing the x to 14 somehow
when i never change the x axis it makes one of the parts sides tip down. the only thing I want my part to do is change the y axis to turn the part left and right and the x axis to change the part to face up or down but I don’t want the part to tilt to left or right which is what the z axis does

this wont work bc the part will spin

the only thing I want my part to do is change the y axis to turn the part left and right and the x axis to change the part to face up or down but I don’t want the part to tilt to left or right which is what the z axis does

I would suggest using TweenService instead of a BodyGyro if that’s the case, it might clear up some things, cause you can just copy-paste the wanted orientation.

Does `Vector3.new(100, 100, math.huge)` work? That should make it exert an infinite amount of force on the Z axis and effectively anchor the Z axis in place.

that would work if the script didn’t change the bodygyros cframe on z axis for no reason

The solution to my problem was to use `CFrame.fromOrientation`.