我当前的堆栈:
- 耳机:Oculus Quest
- Unity:v2019.2.19f1
- Oculus 集成:v12
- 操作系统:MacOs Catilina
我遵循了有关传送的基本教程,并且效果很好:我能够使用左拇指操纵杆来定义头像传送的新目标和方向。但是,将 Oculus Integration for Unity 更新到最新版本 (v12) 后,它停止工作。
这是我的 LocalPlayerController 预制件的结构:
这是 LocomotionController 对象之前的(工作)配置:
更新后,我注意到 2 个脚本发生了变化:LocomotionController.cs
和 TeleportInputHandlerAvatarTouch.cs
:
LocomotionController.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
这个脚本只是添加了两个新字段(我猜是为了新的手部跟踪系统),但我认为它不会对当前配置造成问题。
我完全陷入困境,不知道如何从这里继续。上次升级似乎没有更新其他脚本,我所有的研究都没有成功。
最佳答案
研究让我得出this reddit post感叹同样的问题,但在他们的例子中,他们似乎只是向 PlayerController 添加了两个组件:CapsuleCollider 和 SimpleCapsuleWithStickMovement。如果您搜索要添加到 PlayerController
的组件,则两者都应该显示在您当前的项目中。然后,您显然可以简单地禁用这些组件,并且您的游戏应该可以玩而不会抛出错误,尽管该行为是否是您想要的则是另一个问题。
关于c# - 将 Oculus Unity Integration 升级到 v12 后,传送无法在 Quest 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59939850/