I'm currently using NavMeshAgent as my player character controlled by keyboard or gamepad input. Also, I'm flipping my character instead of turning via controlling localScale as below.
private void FixHeadRotation()
{
float dir = (myAgent.velocity.normalized.x > 0) ? 1 : -1;
transform.localScale = new Vector3(1, 1, dir);
}
However, since I'm relying on the velocity I'm getting the direction(flip) right when moving, but not when I'm not moving(x should be -1 but 1 since no velocity).
I've noticed the NavMeshAgent has built-in function displaying an arrow gizmo over the agent's head. Perhaps I could use that(don't know how atm)? or any other suggestions to this?