Hello everyone!
I’m not sure that i am in right place, because it is about animation and navmesh…
I would like to implement a left and right movement for my character on mouse click, but make him looing forward while moving.
I have a blend tree with 5 states (idle, moving forward, backward, left and right).
But i struggle a little bit with code, don’t really get how to implement the values. So i guess i have to to implement negative and positive values for each axe… Shall i do it with if statement, for exemple if the mouse is on left of the screen :
if (Input.mousePosition.y >= Screen.height / 2)
{
animator.SetFloat("forwardSpeed", 5);
}
And i also some issues with player view. Shall i just set angular speed to 0, or is there some better ways?
Is there some good practice for this problem?
Thank you in advance.