I’m making a 2d game and I have the orientation set as YAxisForward on the AIPath script. The AIPath script is being used to control the movement of the character but I have a separate script to ensure the character is facing it’s target
If you are rotating the agent yourself you probably want to set ai.updateRotation = false to disable the agent’s own rotation.
In this case I think the X and Y rotation comes from the fact that the target and the agent have different Z coordinates. You could instead do something like this:
var dir = -(enemyTargetFinderControllerScript.closestTarget.position - transform.position);
dir.z = 0;
transform.up = dir;