Accessing Animator Unity 2019 methods

Asked

Viewed 72 times

-1

Good afternoon guys I’m having the following doubt, I created animations on Unity Animator inserir a descrição da imagem aqui

doubt is as follows as I access the methods cracked in the Imator via script like the Grounded there and the Animation id, I saw that way on the internet but it seems that n works

using System.Collections; using System.Collections.Generic; using Unityengine;

public class aulaScript : Monobehaviour{

private Animator playerAnimator;

public bool Grounded;
public int idAnimation;

// Start is called before the first frame update
void Start(){
    playerAnimator = GetComponent<Animator>();
}

// Update is called once per frame
void Update(){
    playerAnimator.setBool("grounded", Grounded);
}    

}

1 answer

0

Just change

playerAnimator.SetBool("grounded", Grounded);

for

playerAnimator.SetBool("grounded", true);
  • Assets Scripts aulaScript.Cs(19,24): error CS1061: 'Animator' does not contain a Definition for 'setBool' and no accessible Extension method 'setBool' Accepting a first argument of type 'Animator' could be found (are you Missing a using Directive or an Assembly Reference?)

  • Sorry case is Setbool no setBool I will edit the answer

Browser other questions tagged

You are not signed in. Login or sign up in order to post.