Rotation World Space

Hi,

So basically, I am trying to rotate a cube (for a puzzle) based off player input The UP and Right works once. If i rotate Right twice the up rotation changes and rotates it sideways (as-if it was rotating on the X value).

So in this i get the requested rotation and add it to the previous rotation value.

I then use this to lerp the correct value set the rotation then save it for future rotations.

Can anyone explain why or How its rotating in the X direction (it seems) if there is a simple math node i am missing