【发布时间】: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 都通过统一检查员附加
【问题讨论】:
-
是不动还是不动?
-
当我跑步时,它们会穿透地形对撞机或向上飞
-
我觉得你的轴可能搞混了......你想继续什么轴?