How to allow a 3rd person character to face where the mouse is aiming.
Simply put your character as the Target for "Get Actor Location" and "Set Actor Rotation" and it will look at wherever your mouse is! I tested this as well to make sure it works.
If you don't want debug lines to draw, then change the "Draw Debug Type" under "Single Line Trace for Objects" to "None". As well, this Blueprint will only look at Static geometry (BSP brushes, etc.), so you may want to add more types to the "Make Array" node. Just click "Add pin" and select all of the things that you want to look at from the drop-down.
Thanks so much! BUT... with my top down shooter game (WASD to move north, south, east, west) I needed the player to always face where the mouse was. This blueprint Parralex provided was a great solution! I had to add one more thing... a Break Rot and a Make Rot. This is because with the character would become inverted when mousing over tall objects. SOOOOO, Here is what I did to fix this! Hope it helps someone!
If you simply what the character to face the direction in which the mouse is pointing, take a look at the 3rd Person Blueprint Template and under the Blueprints folder for My Character, go to the Defaults tab and search for Pawn. Check the User Controller Rotation Yaw option and that will allow the pawn to face the direction the mouse is pointing.
Note: The character in this example doesn't animate and rotate towards the camera, there would be a little more involved in this.
Hope this helps points you in the right direction (yes pun intended)!
Follow this question
Once you sign in you will be able to subscribe for any updates here