首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Oculus Go - Detect运动

Oculus Go - Detect运动
EN

Stack Overflow用户
提问于 2018-06-05 11:17:53
回答 1查看 544关注 0票数 1

我是Unity / Oculus Go的新手。我遵循了Unity教程中的滚球游戏,它可以在电脑上运行。我添加了OVRCameraRig并将其安装到Oculus Go上,可以看到游戏,但不能使用触摸板移动。

https://developer.oculus.com/documentation/unity/latest/concepts/unity-integration-tutorial-rollaball-intro/

https://unity3d.com/learn/tutorials/s/roll-ball-tutorial

我知道对于教程来说,它说的是常规的InputManager,下面的代码应该适用于VR。InputManager可以检测到按键或操纵杆在X轴和Y轴上的移动,但Oculus Go没有操纵杆-所以可能InputManager不支持Go?

我知道在Oculus Utilities中有一个OVRInput,但是不知道如何让它移动播放器对象。有什么我可以参考的建议或文章吗?

使用UnityEngine;使用System.Collections;

公共类PlayerController : MonoBehaviour {

代码语言:javascript
复制
public float speed;

private Rigidbody rb;

void Start ()
{
    rb = GetComponent<Rigidbody>();
}

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

    Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

    rb.AddForce (movement * speed);
}

}

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2018-06-05 15:01:08

是的,最简单也是最“原生”的方式是使用Oculus SDK for Unity3d附带的OVRInput。你可以观看PC版的“滚球”教程,看看他们是如何使用键盘上的箭头来增加球的力量的,然后你就可以用OVRInput替换它了。这一系列的教程非常棒。祝好运。

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

https://stackoverflow.com/questions/50691501

复制
相关文章

相似问题

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