【问题标题】:How to use animations on a rigid body not kinematic?如何在非运动学的刚体上使用动画?
【发布时间】:2020-06-12 12:02:04
【问题描述】:

我没有使用动画的经验,我正在尝试在我使用 AddForce 移动的角色上插入动画。 如果我插入步行动画,动画会移动刚体,她决定它移动的速度。如果在动画师中我不应用“Root Motion”,则动画不会移动角色,我可以使用 AddForce 移动它,但动画与角色的速度不同步。 如何将动画的速度与移动刚体的速度联系起来。我希望如果我改变我用来移动角色的“速度”参数,动画的速度也会改变,始终保持同步。

【问题讨论】:

    标签: unity3d animation rigid-bodies


    【解决方案1】:

    我认为这对你有用:

    float speed;//you must set this value with rigidbody's velocity
    Animator animator;
    void Start()
    {
        animator=getComponent<Animator>();
    }
    
    void Update()
    {
        animator.speed=speed;//you can change it with speed/10 to make more realistic
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-14
      • 1970-01-01
      • 2017-05-30
      • 1970-01-01
      相关资源
      最近更新 更多