我有简单的 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
都是通过统一检查员连接的