c# - 将 Oculus Unity 集成升级到 v12 后 Teleport 无法在 Quest 上运行
问题描述
我当前的堆栈:
- 耳机:Oculus Quest
- 统一:v2019.2.19f1
- Oculus 集成:v12
- 操作系统:MacOs Catilina
我遵循了有关传送的基本教程,并且效果很好:我能够使用左摇杆来定义化身传送的新目标和方向。但是,将 Unity 的 Oculus 集成更新到最新版本 (v12) 后,它停止工作。
这是我的 LocalPlayerController 预制件的结构:
这是 LocomotionController 对象的先前(工作)配置:
更新后,我注意到 2 个脚本发生了变化:LocomotionController.cs
和TeleportInputHandlerAvatarTouch.cs
:
运动控制器.cs
如果我们更详细地分析这个脚本,我们可以注意到两个字段 (CharacterController
和PlayerController
) 已经改变了类型。
/************************************************************************************
See SampleFramework license.txt for license terms. Unless required by applicable law
or agreed to in writing, the sample code is provided “AS IS” WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the license for specific
language governing permissions and limitations under the license.
************************************************************************************/
using System;
using UnityEngine;
using System.Collections;
using JetBrains.Annotations;
using UnityEngine.Assertions;
#if UNITY_EDITOR
using UnityEngine.SceneManagement;
#endif
/// <summary>
/// Simply aggregates accessors.
/// </summary>
public class LocomotionController : MonoBehaviour
{
public OVRCameraRig CameraRig;
//public CharacterController CharacterController;
public CapsuleCollider CharacterController;
//public OVRPlayerController PlayerController;
public SimpleCapsuleWithStickMovement PlayerController;
void Start()
{
/*
if (CharacterController == null)
{
CharacterController = GetComponentInParent<CharacterController>();
}
Assert.IsNotNull(CharacterController);
*/
//if (PlayerController == null)
//{
//PlayerController = GetComponentInParent<OVRPlayerController>();
//}
//Assert.IsNotNull(PlayerController);
if(CameraRig == null)
{
CameraRig = FindObjectOfType<OVRCameraRig>();
}
Assert.IsNotNull(CameraRig);
#if UNITY_EDITOR
OVRPlugin.SendEvent("locomotion_controller", (SceneManager.GetActiveScene().name == "Locomotion").ToString(), "sample_framework");
#endif
}
}
我以前只是通过将LocalPlayerController
预制件拖到统一编辑器字段中来设置这些字段,但现在不可能了。不知道我应该在哪里选择那个CapsuleCollider
和SimpleCapsuleWithStickMovement
。如果我触摸左摇杆,我的玩家会四处移动,这不是预期的行为,我不知道如何改变它。
TeleportInputHandlerAvatarTouch.cs
该脚本只是添加了两个新字段(我猜是新的手部跟踪系统),但我认为它不会对当前配置造成问题。
我完全被卡住了,不知道如何从这里开始。上次升级似乎没有更新其他脚本,我所有的研究都没有成功。
解决方案
经过近三天和无数次的实验,我找到了一种配置,可以让 Teleport 与Oculus Quest的 Oculus Unity 集成 v12 一起工作。
1. PlayerController 的设置
这是 Player Controller 对象结构:
你需要禁用CharacterController
和OVRPlayerController
这将重新激活传送激光,但它不太可能适用于所有表面。为了解决这个问题,我们需要一个额外的步骤......
2. LocomotionController 的设置
看起来像引入了一个错误,Aim Collision Type
当设置为时,它会阻止正确的碰撞检测Point
。为了使它工作,我们需要将它设置为Sphere
并给出任何相对较小的半径/高度(在本例中为 0.1)
...这对我有用。
希望这会有所帮助!
推荐阅读
- elasticsearch - 如何统计弹性搜索查询结果中关键字出现的次数
- bundle - 在环境之间转移开发包
- node.js - nodejs:数据库不存在
- python - 问题:相关性总是给出 nan 值
- selenium - 有没有办法使用 maven 而不是整个套件来运行单个机器人框架测试用例?
- html - 在简单的 Spring Boot 应用程序中,图像未显示在网页上
- python - 如何停止模型迁移的无限循环,“模型具有尚未反映的更改” - makemigrations > migrate。相同的消息
- php - OOP PHP 未定义变量
- java - 如何查询事件驱动数据库表中所有对象的当前状态?
- javascript - Internet Explorer 11 计算时区错误