按下按钮无法播放Attack动画,Animator触发器未激活求助
Unity Attack动画触发器无法触发问题

我尝试通过触发名为Attack的参数来播放Attack动画,但按下指定的触发按键(C键)后,动画无法运行,触发器也未激活。
以下是我的代码:
using System.Collections; using System.Collections.Generic; using UnityEngine; public class attack : MonoBehaviour { public Animator animator; void Update() { if (Input.GetKeyDown(KeyCode.C)) { Attack(); } } void Attack() { animator.SetTrigger("Attack"); } }
我是跟着一段视频进行操作的。
内容的提问来源于stack exchange,提问作者Omar afandi
相关产品推荐
相关产品推荐

