我的动画师正在创建同时动画吗? [英] My animator is creating Simultaneous animation?
问题描述
我有两个角色(敌人)具有相同的Animator Controller,他们同时播放动画.他们制作动画的时间是完全相同的.我有办法改变它们,使它们看起来更自然吗?
I have two characters (enemy) having the same Animator Controller and they play animations Simultaneously. The timing for their animations is exactly the same. Is there a way I can make variations among them so that they look a bit more natural.
推荐答案
此处的问题是,即使您访问Animator
的正确实例,它们仍然共享相同的AnimatorController
资产.
The issue here is that even if you access the correct instance of the Animator
they all still share the same AnimatorController
asset.
=>每个动画师实例都需要单独的AnimatorControllers
.
=> You need a separate individual AnimatorControllers
for each instance of the animator.
您可以在运行时为每个实例创建它们,例如使用
You can create them for each instance on runtime e.g. using
[RequrieComponent(typeof(Animator))]
public class AnimatorControllerCloner : MonoBehaviour
{
[SerializeField] private Animator _animator;
private void Start()
{
if(!_animator) _animator = GetComponent<Animator>();
var runtimeController = _animator.runtimeAnimatorController;
var newController = Instantiate(runtimeController);
_animator.runtimeAnimatorController = newController;
}
}
这篇关于我的动画师正在创建同时动画吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!