Third person character look at mouse


How to rotate character, using CURSOR position, not “Location” from “Get hit result uder cursor”.
Why? Because using hit result goes laggy, when dealing with different Z-values of terrain. For example, if mouse is above some pit/hole - character will turn much more than it should.

So, any ideas?


It does not go “laggy” as lag is a latency issue. What might happen is that depending on the angle of your game, the location it hits might be quite a bit off to the side. What you want is to calculate where the mouse hits on the plane upon which the character walks.

If you dont want him to turn to the location at which you click, but towards the cursor when you click, then you have to go back into screen space, extract the mouse pointers location relative to the center of the screen, if that is where your character is. If it is not you have to do some math yourself and calculate the intersection between the plane of choice with the ray going from the camera through the mouse pointer and then into the ground.

Both of these require quite a bit of work and math to be solved.

It would also help if you could upload some pictures for us to see. That way we can help you more since we understand the problem better.