WheelCollider无法使用Unity 5

时间:2016-08-22 10:46:42

标签: unity3d unity5 collider

我有简单的3D车,它有车轮colliders。现在我使用下面编写的脚本并分配它们colliders但是当我运行我的游戏时没有任何事情发生

using UnityEngine;
using System.Collections;

public class CarMoves : MonoBehaviour {

    public WheelCollider wheelFL;
    public WheelCollider wheelFR;
    public WheelCollider wheelBL;
    public WheelCollider wheelBR;
    float Maxtorque = 50;

    // Use this for initialization
    void Start () {

    }

    // Update is called once per frame
    void FixedUpdate () {
        wheelBR.motorTorque = Maxtorque * Input.GetAxis("Vertical");
        wheelBL.motorTorque = Maxtorque * Input.GetAxis("Vertical");
        wheelFL.steerAngle = 10 * Input.GetAxis("Horizontal");
        wheelFR.steerAngle = 10 * Input.GetAxis("Horizontal");

    }

}

所有这些公开colliders都通过团结检查员

附上

1 个答案:

答案 0 :(得分:0)

确保汽车底座刚体上的质量至少为1000千克。

此外,车轮碰撞悬架弹簧至12000+和阻尼器至大约2000

相关问题