好吧,我在unity中的角色上有一些动画,但是当我点击播放时,在Animator选项卡中,我看到蓝色的条状物仍然在开头。虽然,如果(当我还在播放模式下)我在animator中取消选中我的布尔变量的框,它就能正常工作。这是我的代码,请帮助我。
{
foreach(AnimatorControllerParameter parameter in shaggyAnim.parameters)
{
shaggyAnim.SetBool (parameter.name, false);//stops the other animations
shaggyAnim.SetBool(anim, true);//plays the wanted animation
//for each animation I declared a bool variable inside unity animator
}
}```
你为什么不直接设置默认状态?你不需要在一开始就选中所有的动画参数。只要把你想要的动画设置为默认状态,unity就会只在开始时播放该动画。只要确保过渡期的其他参数都是假的就可以了。