I am in the process of making a 2d character controller but I get an error but it is not a scripting error. When the character moves in the right direction the character doesn’t use the animation which is set by the animator it uses after a certain time for about 2 seconds then stops this continues until it falls of
Here is the script:
using UnityEngine;
using System.Collections;
public class characterMovement : MonoBehaviour {
float speed = 5;
Animator anim;
void Start ()
{
anim = GetComponent<Animator>();
}
void Update ()
{
anim.SetFloat ("Speed", Mathf.Abs (Input.GetAxis ("Horizontal")));
transform.Translate(speed * Time.deltaTime, 0f, 0f);
}
}