【问题标题】:WheelCollider not working using Unity 5WheelCollider 无法使用 Unity 5
【发布时间】:2016-08-25 22:15:57
【问题描述】:

我有一个简单的 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 都通过统一检查员附加

【问题讨论】:

  • 是不动还是不动?
  • 当我跑步时,它们会穿透地形对撞机或向上飞
  • 我觉得你的轴可能搞混了......你想继续什么轴?

标签: unity3d unity5 collider


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-24
    • 1970-01-01
    • 2017-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多