Affect Local Rotation by World Axis

Hi, I am attempting to rotate an actor’s local rotation given the global world rotation. We are interfacing with three different coordinate spaces (trackers, HMD, and UE4) and the trackers only provide world rotation relative the IR sensors in our room, I would like for that to affect our actor. For Example: the weapon currently rotates different axis depending the direction you are facing because if you face World +X and rotate; it matches the local axis so the rotation is fine. But if you face World +Y and rotate, the X and Y axis are flipped because if you do the same rotation as facing +X it will be +Y World and that affects the local actor’s +Y which is a different rotation as local +X. When facing World X, and you Rotate Local +X, they match. When facing World +Y and you Rotate Local +X, the Local +Y rotates.
I apologize if this is confusing I can clear it up if need be.
I want to keep the same rotation no matter the world direction facing but given world rotation. So facing +Y, Rotate Local +X, The rotation received will be +Y, but local will rotate +X.
Thank you.

For this you’re going to want to get acquainted with Transform Rotation and Inverse Transform Rotation. Transform Rotation | Unreal Engine Documentation

This will allow you to convert a component’s transform from local to world space and vice-versa (inverse). Without seeing a blueprint I can’t tell you what you should do exactly, but this is the node you want.

1 Like