-1

Boa tarde pessoal eu estou com a seguinte duvida, eu criei umas animações no Animator da unity inserir a descrição da imagem aqui

a duvida é o seguinte como eu acesso os metodos crados no animator via script como o grounded ali e o id Animation, eu vi dessa forma na internet mas parece que n funciona

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 Resposta 1

0

É só alterar

playerAnimator.SetBool("grounded", Grounded);

para

playerAnimator.SetBool("grounded", true);
2
  • 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?) 2/01/2020 às 3:40
  • Desculpa no caso é SetBool não setBool vou editar a resposta 2/01/2020 às 23:52

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .