Actor rotation to match gamepad stick rotation, how?


So i am trying to create a kinda “radial” selection screen that works in 3D. I have this “weapon” if you will and when player goes to weapon selection the four icons will pop-up. Now player should be able to use the thumbstick to select the weapon he/she wants. What i am trying to achieve is to place an invisible actor that will rotate towards the thumbstick location and when it collides with an icon the game knows that specific icon is selected.


Now i tried to do something like this in BP:


This only works in -90 - 90 degrees so it is not good enough. Any idea how to make it work so it would always face towards where thumbstick is pressed? If i could convert gamepad to 0-360 it would be easy to set that as relative rotation of character.

There are dozens of different ways to achieve what you want.

You could do it like this:

In your Project Settings

In your Blueprint

Edit: Maybe I should explain it a bit… The branch checking “WantsToRotate” checks if the stick rotation values are strong enough (out of your deadzone of 0.2). The RotationVector should be self explanatory and RInterpTo makes the rotation very smooth. You don’t need the RInterpTo, you can just plug the return value of “MakeRotFromX” into your SetRotation function.