movement bug

Hello, my char only goes foward, i think there is a bug on script, so, there are my script

using UnityEngine;
using System.Collections;

public class mov_char : MonoBehaviour {


    public float speed;


    // Use this for initialization
    void Start () {

        speed = 2.0f;
   
    }
   
    // Update is called once per frame
    void Update(){

        mov ();

}

    void mov(){

        if (Input.GetAxisRaw("Horizontal") > 0) {
   
            transform.Translate (Vector2.right * speed * Time.deltaTime);
            transform.eulerAngles = new Vector2 (0, 0);
        }
        if (Input.GetAxisRaw("Horizontal") < 0) {


            transform.Translate (-Vector2.right * speed * Time.deltaTime);
            transform.eulerAngles = new Vector2 (0, 180);

        }

    }
}

Can anybody help me? whats wrong?

you are rotating your object, so try to move it right again for moving left
transform.Translate (Vector2.rightspeedTime.deltaTime);

thanks !

You can use “transform.right” instead of Vector2.right to get the object’s ‘forward’ direction regardless of rotation.