I am new to Unity. I have searched but I couldn't find any answers on this. Here is my code:
somethingPosition = new Vector3(player.transform.position.x, transform.position.y, player.transform.position.z);
transform.LookAt(somethingPosition);
The somethingPosition
only allows rotation of the Y axis so. Anyways, I have this script on the enemy AI.
The issue is this: the enemy looks at the player but looks to the left of the player. The same issue occurs when I have my follow code happen:
transform.position = Vector3.MoveTowards(transform.position, player.position, speed * Time.deltaTime);
The enemy will continue going to the left of the player but will not hit the player. What are some suggestions you guys can survive? Thanks!
I am aswell using a NavMesh and NavMeshAgent