首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用Unity 5时WheelCollider无法正常工作

使用Unity 5时WheelCollider无法正常工作
EN

Stack Overflow用户
提问于 2016-08-22 18:46:42
回答 1查看 1.2K关注 0票数 1

我有一个简单的3D汽车,它有车轮colliders。现在我正在使用下面的脚本,并为它们分配colliders,但是当我运行我的游戏时,什么也没有发生

代码语言:javascript
运行
复制
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附加的

EN

Stack Overflow用户

回答已采纳

发布于 2016-08-25 22:15:58

确保车座上的刚体质量至少为1000 at。

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

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39077556

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档