Why does pitch rotation affect roll?

I want to control my actor to rotate in pitch and yaw, the yaw rotation works perfect, but the pitch rotation keeps affecting the roll rotation, however I want to make the roll rotation be 0 all the time. I tried to force the roll rotation to be 0, but it doesn’t work. Anyone can give me any idea?

this sounds like a world or relative rotation issue, how are you performing the rotations?

I ran into a similar problem and came up with an easy solution. Not sure if it will work for your application, but it did for me. I also tried locking the roll or x value but it also did nothing.

I have my inputs set under Edit → Project Settings → Input → Axis mappings

Inputs

And here is my setup
Setup

The ‘Add World Rotation’ connected with the input gives a nice smooth rotation while the key is held. But when I left it like that… I would get that problem where if I was rotated to the side and then started rotating up or down it would automatically add roll (change the X).

To get around it I just set the roll to zero every time it finishes moving.

To move up, you would just copy all that, change the input ‘P1MoveRIght’ to input 'P1MoveUp. Then instead of connecting the value to Z, you would connect it to Y.

If this doesn’t work for your application it might be possible to get the same effect breaking the object into two pieces and using a socket. Then rotate the base in only z and the top could rotate in y.

I have not tried and it seems slightly complicated, but I imagine it would fix rolling issues as well.

the base could be nothing more than a paper thin layer.