【问题标题】:Unity - move animated game object with rigidbody.velocityUnity - 使用刚体.速度移动动画游戏对象
【发布时间】:2015-08-31 23:38:01
【问题描述】:

我有一个动画角色,我需要向前移动它

我将刚体添加到我的角色和移动器类中

当我禁用动画控制器时,它会移动

我的搬家班

 using UnityEngine;
    using System.Collections;

    public class Mover : MonoBehaviour {


        public float speed;
        // Use this for initialization
        void Start () {
            GetComponent<Rigidbody>().velocity = transform.forward * speed;

        }


    }

任何建议我如何解决这个问题

【问题讨论】:

    标签: c# unity3d


    【解决方案1】:

    我找到答案了

    只需取消选中Apply Root Motion

    【讨论】:

      【解决方案2】:

      可能想把它放在Update() 这样它就不会被调用一次。

      void Update () {
          GetComponent<Rigidbody>().velocity = transform.forward * speed * Time.smoothDeltaTime;
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-11-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多