C# Unity-使用rigidbody.velocity移动动画游戏对象
我有一个动画角色,我需要把它向前推进 我将刚体添加到我的角色和移动器类中C# Unity-使用rigidbody.velocity移动动画游戏对象,c#,unity3d,C#,Unity3d,我有一个动画角色,我需要把它向前推进 我将刚体添加到我的角色和移动器类中 using UnityEngine; using System.Collections; public class Mover : MonoBehaviour { public float speed; // Use this for initialization void Start () { GetComponent<
using UnityEngine;
using System.Collections;
public class Mover : MonoBehaviour {
public float speed;
// Use this for initialization
void Start () {
GetComponent<Rigidbody>().velocity = transform.forward * speed;
}
}
当我禁用动画控制器时,它会移动
我的搬运工班
using UnityEngine;
using System.Collections;
public class Mover : MonoBehaviour {
public float speed;
// Use this for initialization
void Start () {
GetComponent<Rigidbody>().velocity = transform.forward * speed;
}
}
使用UnityEngine;
使用系统集合;
公共阶级运动者:单一行为{
公众浮标速度;
//用于初始化
无效开始(){
GetComponent().velocity=transform.forward*速度;
}
}
有什么建议我可以这样做吗
我找到了答案
只需取消选中“应用根运动”
我找到了答案
只需取消选中“应用根运动”
我找到了答案
只需取消选中“应用根运动”
我找到了答案
只需取消选中“应用根运动”
可能需要将其放入
Update()
中,这样它就不会只调用一次
void Update () {
GetComponent<Rigidbody>().velocity = transform.forward * speed * Time.smoothDeltaTime;
}
void更新(){
GetComponent().velocity=transform.forward*speed*Time.smoothDeltaTime;
}
可能需要将其放入Update()
中,这样它就不会只调用一次
void Update () {
GetComponent<Rigidbody>().velocity = transform.forward * speed * Time.smoothDeltaTime;
}
void更新(){
GetComponent().velocity=transform.forward*speed*Time.smoothDeltaTime;
}
可能需要将其放入Update()
中,这样它就不会只调用一次
void Update () {
GetComponent<Rigidbody>().velocity = transform.forward * speed * Time.smoothDeltaTime;
}
void更新(){
GetComponent().velocity=transform.forward*speed*Time.smoothDeltaTime;
}
可能需要将其放入Update()
中,这样它就不会只调用一次
void Update () {
GetComponent<Rigidbody>().velocity = transform.forward * speed * Time.smoothDeltaTime;
}
void更新(){
GetComponent().velocity=transform.forward*speed*Time.smoothDeltaTime;
}