0
このコードを使用するとアニメーションがユニティで再生されないのはなぜですか?どのようにしてアニメーションが終了するのをプログラムが待たせることができますか? JavaScript(またはUnityScript)ではこのアプローチが有効でした。ユニティアニメーション - yield yield new WaitForSeconds(secs)not working
public bool Attacking { get; set; }
private Animator anim;
void Start()
{
anim = gameObject.GetComponent<Animator>();
}
private IEnumerator Attack()
{
Attacking = true;
anim.SetTrigger("Attack"); // this is not playing
yield return new WaitForSeconds(attackLength);
Attacking = false;
}
:だからここ
はソリューションですか? –
'Attack()'コルーチン関数を呼び出す/起動する必要があります。 'StartCoroutine(Attack());' – Programmer