je suis entrain de suivre ce tutoriel:
https://youtu.be/VyVJ3GK64sA
Quand j'appuie sur la flèche avant, la valeur de la variable Walkfront devrait changer à true mais rien ne se passe.
Le problème ne vient pas du GetAxis car j'ai bien la valeur 1 quand j'appuie sur la flèche avant.
Code : Tout sélectionner
using UnityEngine;
using System.Collections;
public class perso : MonoBehaviour {
public float VitesseMarche =3f;
private Animator anim;
// Use this for initialization
void Start () {
anim = GetComponent<Animator> ();
}
// Update is called once per frame
void Update () {
if(Input.GetAxis("Vertical")>0);
{
//avance
anim.SetBool("WalkFront", true);
Debug.Log (Input.GetAxis("Vertical"));
}
if(Input.GetAxis("Horizontal")==0);
{
//avance
anim.SetBool("WalkFront", false);
}
}
}