Mouse move to control the animation

Hello! I do not know much English, so I’m sorry for the mistakes: D I’m doing a 2D platformer in which you control your character with the mouse. I need to move in the Y-axis to less than “a” up to play its one animation down - another, when you stop to play its third, and moving on more than “a” to play its fourth. Please help me write a script! I would be very grateful :slight_smile: Here’s the script:

using UnityEngine;
using System.Collections;

public class MouseControl : MonoBehaviour {

void Start () {}
public float speed=0.1f;
Vector3 MousePos=Vector3.zero;
void Update () {
MousePos = new Vector3(speed, Input.GetAxis("Mouse Y"), 0);
transform.position+=MousePos;
}

}

A very general question.

I recommend doing tutorials that have animation in them, like the lerpz 2d tutorial in the asset store.

Also there is useful code in this script