How do I make my actor look at the center of the camera view when holding right mouse button (in third person)?

So I am making my “game”, and I would like a mechanic that makes the character turn to where you’re looking at with the mouse when you’re holding right mouse button. I have puzzled around a bit but I just can’t seem to find the answer.

Can you guys help me?

Also, if you want to help me out more with UE4 you can add me on discord: Jevise#6274
Thanks!

Line trace from your cursor position to the ground, then set your character’s rotation to be the value of a Find Look at Rotation using the character’s location and the line-trace hit location. You’ll also want to zero-out the Z values so that the character doesn’t rotate up or down.

To get the Mouse location and direction for trace, use this…

192172-ue_answerpic19c.png