UE4 – Rotate Character To Look At Mouse Location (Top Down)

UE4 – Rotate Character To Look At Mouse Location (Top Down)

Posted by

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:

UE4_Rotate_To_Mouse_Location_TopDown_Demo

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.

UE4_Rotate_To_Mouse_Location_TopDown

    3 Comments

  1. Danke!

  2. Thank you! but if i add camera rotation? how to preserve wasd direction right accordig to player view?

    thanks!

  3. hi, Blueprint is very helpful. But, character keeps on rotating and no flexibility in movement. why it’s happening ..please help?

Post a Reply

Your email address will not be published. Required fields are marked *

Share This