UE4 – Rotate Character To Look At Mouse Location (Top Down)
Purpose: The Purpose of this procedure is to create a system which allows you to rotate your character/hero to look at the mouse location on the screen. Great for top down shooters and twin stick shooters.
What It Looks Like When Completed:
1 – Create a Function “Aim To Cross Hair”
2 – Get Player Controller and Set Control Rotation
3 – Get the New Rotation By Getting Player Controller, Get Hit Result, Break It, Then Do Calculations (View Image Below).
Note: I have branch before exiting the function, but this is for mechanic in the game I am building.