Day 5. 在设置Unity VR环境时遇到的问题,以及不存在的解法Q

Warning与error直扑而来XDD

蛮头痛的,我目前遇到的有两个问题被回报为Bug。

简单来说,我现在的目标是让HMD Mock可以顺利地在没有头盔的情况下,模拟VR的操作输入。
 
 

1. 软硬体配备:

Mac 10.15.5
Unity 2020.3.14f1
 
 

2. 专案设定:

  • 3D Project

设定部分

  • Project Setting:
    • XR Plug-in Management: 勾选PC, Mac & Linux Standalone的Mock HMD Loader
    • Quality: Pixel Light Count = 1, 取消Soft Particles
    • *1Preset Manager: Preset XRI Default Left/Right Controller,并分别加入Left/Right Filter
    • Player: Other Settings > Configuration > Active Input Handling = Both
    • Package Manager: 勾选Enable Preview Packages
  • Package Manager:
    • 安装XR Plugin Management
    • 安装XR Interaction Toolkit,并import Default Input ActionsXR Device Simulator
       
       

场景内置

  • Hierarchy:
    • Main Camera: Inspector的Position&Rotation重置为全0
    • 放入XR Device Simulator
    • 创建XR Rig:
      • 浏览Assets/Samples/XR Interaction Toolkit/1.0.0-pre.6/Default Input Action,将XRI Default Left/Right Controller Add to ActionBasedController default -> *1去设定Preset Manager
      • XR Rig Add Component: Input Action Manager,并把XRI Default Input Actions加入至Input Aciton ManagerAction Assests List

 


 

3. 遇到的Bug

(1) 三角形!Invalid AssetDatabase path: /Assets/Samples/XR Interaction Toolkit/1.0.0-pre.6/Default Input Actions. Use path relative to the project folder.

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

import Default Input Actions 和 XR Device Simulator遇到的错误。
 
 
 

(2) 只要勾选Mock HMD Loader,在PlayMode下,切回Scene会闪烁黑屏

已知Unity Community有此讨论:
[Bug] Flickering shadow issue
 
 
 

(3) 按照参考影片做完後,在PlayMode下可看到Controller,但按下keyboard或移动滑鼠皆无任何反应


Console没有任何讯息
 
 
 

(4) 如果将XR Rig的Input Action Manager的Action Assests换成XR Device Simulator Controls,则Console会出现以下三角形!,貌似都是有关XR Interaction toolkit的讯息

  • 'Enable Input Tracking' is enabled, but Position and/or Rotation Action is disabled. The pose of the controller will not be updated correctly until the Input Actions are enabled. Input Actions in an Input Action Asset must be explicitly enabled to read the current value of the action. The Input Action Manager behavior can be added to a GameObject in a Scene and used to enable all Input Actions in a referenced Input Action Asset.
    UnityEngine.XR.Interaction.Toolkit.XRBaseController:Update () (at Library/PackageCache/[email protected]/Runtime/Interaction/Controllers/XRBaseController.cs:300)

  • 'Enable Input Actions' is enabled, but Select, Activate, and/or UI Press Action is disabled. The controller input will not be handled correctly until the Input Actions are enabled. Input Actions in an Input Action Asset must be explicitly enabled to read the current value of the action. The Input Action Manager behavior can be added to a GameObject in a Scene and used to enable all Input Actions in a referenced Input Action Asset.
    UnityEngine.XR.Interaction.Toolkit.XRBaseController:Update () (at Library/PackageCache/[email protected]/Runtime/Interaction/Controllers/XRBaseController.cs:300)

  • 'Enable Input Tracking' is enabled, but Position and/or Rotation Action is disabled. The pose of the controller will not be updated correctly until the Input Actions are enabled. Input Actions in an Input Action Asset must be explicitly enabled to read the current value of the action. The Input Action Manager behavior can be added to a GameObject in a Scene and used to enable all Input Actions in a referenced Input Action Asset.
    UnityEngine.XR.Interaction.Toolkit.XRBaseController:Update () (at Library/PackageCache/[email protected]/Runtime/Interaction/Controllers/XRBaseController.cs:300)

  • 'Enable Input Actions' is enabled, but Select, Activate, and/or UI Press Action is disabled. The controller input will not be handled correctly until the Input Actions are enabled. Input Actions in an Input Action Asset must be explicitly enabled to read the current value of the action. The Input Action Manager behavior can be added to a GameObject in a Scene and used to enable all Input Actions in a referenced Input Action Asset.
    UnityEngine.XR.Interaction.Toolkit.XRBaseController:Update () (at Library/PackageCache/[email protected]/Runtime/Interaction/Controllers/XRBaseController.cs:300)

明天搞点轻松的,来去逛头盔 (・∀・)

 
参考:
https://www.youtube.com/watch?v=UlqdHrfXppo&ab_channel=Valem
https://docs.unity3d.com/Manual/com.unity.xr.mock-hmd.html
https://forum.unity.com/threads/attempting-to-determine-the-size-of-an-unknown-feature-type-id-1-while-using-mockhmd.1021825/
https://forum.unity.com/threads/flickering-shadow-issue.954705/


<<:  Day5-75. Sort Colors

>>:  物件的建构与物件实体语法

[Lesson16] Data Binding

使用DataBinding,首先在build.gradle (Module: app)里增加 and...

[day22]Vue实作-交易建立页面

交易建立页面 功能规划 简单建置交易建立的页面,填入住户代号、金额以及选择转帐或信用卡缴费。 交易方...

[13th][Day21] scratch

scratch base image 建立最小 image 之前 build 的许多 image 都...

30天不间断的文章之旅_参数的基本介绍

昨天讲了函式,那今天来讲讲参数吧! 那老样子若有错误或需要补充的地方,也欢迎在下方留言让我知道喔~~...

Day27 海鲜义大利炖饭Risotto

在地狱厨房中,常常看到有人因为Risotto翻车导致戈登大吼骂人的画面,决定来挑战看看传统义大利炖...