flip enemy

ive been looking all day but cant find the right answer… i want to my enemy flip based on where is walking, this is my script i hope can help me thx

using UnityEngine;
using System.Collections;

public class EnemieFollow : MonoBehaviour {

	public Transform player;

	public float moveSpeed;
	public float distance;
	private float range;

	Animator anim;

	




	void Start () 
	{
		anim = GetComponent<Animator>();
		

	}
	


	void Update () 
	{
		
		range = Vector2.Distance(transform.position, player.position);

		if(range > distance)
		{
			Debug.Log("Range");
			transform.position = Vector2.MoveTowards(transform.position, player.position, moveSpeed * Time.deltaTime);
			
			anim.Play("Walk");
		
		}

	}
}

Compare the horizontal value of the direction it is moving/targeting/etc. A hacky solution to facing a certain direction without having different sprites is to invert the scale. If you are targeting the player and if your sprite by default faces right…

    if(player.position.x > transform.position.x){
    //face right
    transform.localScale = new Vector3(1,1,1);
    }else if(player.position.x < transform.position.x){
    //face left
    transform.localScale = new Vector3(-1,1,1);
    }