Weird CFrame behavior?

I looked all over the forum and found nothing.

weld.C1 = CFrame.new(0,-0.15,0) * CFrame.fromEulerAnglesYXZ(-90,0,0)

This gives a different CFrame.
image

I’m not sure what’s causing this but I’ve been looking for a fix for 2 hours and it’s ruining my game’s player experience.

I’m not sure how 0 in radians is 161.383, or why the position changes so much. Can someone explain and potentially give a solution?

CFraming by exactly 90 degrees causes issues like this. If you rotate the X axis 90 degrees it aligns with the Y axis and changes done to either of those may affect the other. It’s called gimbal lock and causes weird numbers like this.

There are plenty of topics on the forums about gimbal lock.

Is the item placed at 90 degrees in the workspace, or is it actually placed at strange angles?

The item is placed at 0,0,0 in workspace.

Could you link me a topic about gimbal lock, or if you know a fix yourself?

What I meant is that with the Orientation of -63.38, -161.383, -179.998 how does the item look in the workspace? Does it seem to be ‘square’ to the workspace? I’ve noticed CFrames with numbers like yours that mostly appear to be very close to the 0, 90, -90, and 180 angles in the workspace.

All I did was search ‘gimbal lock’ in the forums before, or just google it to learn what it is.

No, it is positioned far from the part0 at a weird angle. I’ll look into it, thanks! The C0 is normal and what i set it to but the C1 isn’t.