【问题标题】:How to add a Joystick from Standard Assets in Unity 5?如何在 Unity 5 中从标准资产添加操纵杆?
【发布时间】:2015-09-17 06:31:32
【问题描述】:

我完全是 Unity 的初学者(3 天前下载了 Unity)。我创建了一个简单的游戏,我可以使用此代码用键盘移动玩家 -

void FixedUpdate () {
            float speed = 250;
    float moveHorizontal = Input.GetAxis ("Horizontal");
    float moveVertical = Input.GetAxis ("Vertical");

    Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    GetComponent<Rigidbody>().AddForce (movement * speed * Time.deltaTime);
}

但是,我想在 Android 中玩游戏,为此我需要使用操纵杆。谁能告诉我如何在标准资产中使用操纵杆?

【问题讨论】:

    标签: c# android unity3d joystick


    【解决方案1】:

    我帮助了this Asset。还有一个关于实现的视频教程。

    【讨论】:

      【解决方案2】:

      去掉 Time.deltaTime,Time.deltaTime 是为 Update() 而不是 FixedUpdate()...

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多