How to prevent Yaw/Pitch from affecting Roll in 'add local rotation'?

This code:

Will do this:
output

You might not see the numbers, but you can clearly tell that it starts at 0.0 and then changes even if I did not ‘add’ to the X at all in the code.

I want the X to remain unaffected by changes to Y and Z, how can I do that?

I know I can use relative/world rotation instead, however if I do that then the pitch and yaw do not account for roll when turning.

Closest I’ve been able to get so far is this, I’m accepting it as a solution cuz it actually works but I hope someone comes along with a better one:


Lock Roll is On whenever X = 0.

Contents of the function at the end:

It produces this result, which is basically what I want, besides a few minor kinks.
output

My problem is that I just really do not like this solution, I would prefer something more elegant.

The biggest issue imo is that some of the input is wasted on the roll leading to very mildly inconsistent rotation amounts per input.