How can I limit Aiming to screen space?

Hi, I’ve been trying to setup a control system for a new project. I have the movement system working as intended, with the UE4 logo as a billboard attached by a spring arm (so it reacts to objects in front of the player) as a placeholder for the reticle.

Now I want to set up the aiming to allow the player to move the reticle anywhere on screen, and to rotate the ship to face it.

I have tried a couple of methods but neither really give the desired effect.

  1. Rotating the ship, limited by a range of rotation from its spawn rotation. gif blueprint
  2. Moving the billboard itself then using Find Look at Rotation to set the ship rotation so its pointing at the reticle. gif blueprint


So far I have managed to limit the players aiming, now I simply check if the input added to the players current rotation is larger than the rotation range I’ve set and clamp it. blueprint (horizontal aiming works the same but uses rotation yaw)

NOTE: This will limit the players aiming to a rectangular region, which in my case (designing twin stick controls) feels a bit clunky.

Do you have blueprints for aiming left/right?

It depends on how you are moving the aim. I believe there is a function on player controller called Convert Mouse Location to World Space, that might be helpful since it gaves you origin and direction.