How to make a VR joystick?

I need to make a joystick that takes the motion controller’s rotation and rotates the joystick to match the angle(without the Z axis), but everything I have tried made it rotate weirdly, being either at a slightly offset angle or the rotation was inverted. Can anyone tell me what to do? (An explanation of why to do that would be nice since I’m relatively new to Unreal Engine)