How to limit rotation without gimbal lock?

I put your code into a staticmech actor, but it still cannot work even in only one axis. Anything wrong with my code? Thank you!


Record vid is also uploaded here: