I want to make a boy that is walking on a 2D World . I want to make it when I press right arrow to play animation that is included in the boy sprite and when I press left arrow to change direction horizontally and play the animation that is included - Sorry for bad English
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public bool animation_bool;
void Update()
{
if(animation_bool == true)
{
animation.Play("Boy");
}
if(Input.GetButtonDown("d"))
{
animation_bool = true;
}
}
}