我有一个简单的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都是通过unity inspector附加的
发布于 2016-08-25 22:15:58
确保车座上的刚体质量至少为1000 at。
此外,车轮碰撞悬挂弹簧12000+和阻尼器约2000
https://stackoverflow.com/questions/39077556
复制相似问题