Animation in android game not working

Hi, so I have this animation that needs to be played when the player is moving. It is working in the editor but it doesn’t work on my android phone. Is there something wrong with my script?`public float speed=6f;
Animator anim;

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

}

void Update () {
	if (Input.touchCount == 1)
	{
		Touch touch = Input.touches[0];

		if (touch.position.x > Screen.width/2){
			transform.Translate(Vector2.right*speed*Time.deltaTime);
			transform.eulerAngles = new Vector2(0,0);
		}
		else if (touch.position.x < Screen.width/2){
			transform.Translate(Vector2.right*speed*Time.deltaTime);
			transform.eulerAngles = new Vector2(0,180);
		}
		anim.SetFloat ("speed", Mathf.Abs (Input.GetAxisRaw("Horizontal")));

	}
}`

I have a variable, speed, which is 0 when the player is still and it’s set to 1 to make the player move.

Problem with (Input.GetAxisRaw(“Horizontal”))

input.getaxisraw

This only works with keyboard and joystick. you need a different method of increasing or decreasing the speed with touch.

You can use TouchPhase.Began and TouchPhase.End to set the speed

Go into animation tab… Right click rotation… Change the interpolation property to quaternion … Also works with camera animation.