Player's tilting after mouse click

When I click on the ground, the player will follow my cursor but when the position of the cursor will be reached, it starts tilting. How do I stop that?

Hi,

In which course and lecture are you?

1 Like

The course is Unity Turn Based Strategy (https://www.gamedev.tv/courses/enrolled/1722359)
The lecture is n.18 Unit click to move (Unit Click to Move | GameDev.tv)

Thanks for the information. I’ve just assigned the relevant tag to your thread, so @CodeMonkey will be able to find it. :slight_smile:

By tilting I’m guessing you mean the player is “falling” forward/backwards. Make sure all of your logic is on Y = 0, otherwise when modifying the transform.forward to rotate the player it will also rotate along the X and Z axis instead of just the Y axis.
So add some Debug.Log to test your target position and your Unit position, both should always have a Y = 0

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms