Enemy Not Facing target direction (waypoint) correctly when moving between waypoints

I’m working on a 2D sidescroller where my Z axis is always “0”. I’m importing FBX Models from Cheetah 3d with animations attached. I have the animations set to loop when the enemy is moving back and forth between waypoints. It’s a simple waypoint system where the enemy travels to one waypoint then turns to face the second waypoint and travels to it (constant loop). Just a ping pong waypoint system (simple patrol for an enemy). The problem is that the character never faces the right direction when moving from waypoint to waypoint. For instance… one enemy is about 45 degrees off of facing straight ahead… and when he hits his waypoint and turns around he’s 45 degrees off of facing straight heading in the other direction. Another enemy is completely faced backwards. He literally moves backwards from waypoint to waypoint. I am not sure if it’s my import settings that are screwing this up or if I should be doing something in a script that I’m not. Here is the latest script that I’m working with… wrote several different scripts, tried tons of tutorials, and other scripts and no luck still… same thing over and over… anyhow here’s what I got… if anyone has any suggestions or solutions in JS or C# I’d appreciate it (p.s. it makes no difference if I reference global or local positions):

var pathpoint : Transform[]; 				var currentPathPoint : int;

var speed : float = 5; var loop : boolean = true;
var player : Transform; var searchPlayer : boolean = false;
var viewDist : float = 10; var maxPathDist : float = 40;

function Awake(){ pathpoint[0] = transform; }
function Update(){
if(currentPathPoint < pathpoint.length){

var target : Vector3 = pathpoint[currentPathPoint].localPosition;

var moveDirection : Vector3 = target - transform.localPosition;

var velocity = rigidbody.velocity;

var playerDist : Vector3 = player.localPosition - transform.localPosition;

if(moveDirection.magnitude < 1){


else if(searchPlayer == true){

if(playerDist.magnitude < viewDist){

velocity = Vector3.zero;

target = player.localPosition;

velocity = (player.localPosition - transform.localPosition).normalized * speed;}

if((player.localPosition - pathpoint[currentPathPoint].localPosition).magnitude > maxPathDist){

target = pathpoint[currentPathPoint].localPosition;

velocity = moveDirection.normalized * speed;

} }

else{ velocity = moveDirection.normalized * speed; } }

else{ if(loop){ currentPathPoint = 0; } else{ velocity = Vector3.zero; } }

rigidbody.velocity = velocity; transform.LookAt(target);}`

is the enemy facing on the blue line??