iT邦幫忙

2021 iThome 鐵人賽

DAY 5
1
Software Development

從零開始了解Unity或Unreal Engine應用於VR軟體開發系列 第 5

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/com.unity.xr.interaction.toolkit@1.0.0-pre.6/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/com.unity.xr.interaction.toolkit@1.0.0-pre.6/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/com.unity.xr.interaction.toolkit@1.0.0-pre.6/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/com.unity.xr.interaction.toolkit@1.0.0-pre.6/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/


上一篇
Day 4. 今天要幹嘛?
下一篇
Day 6. 列一下VR頭盔
系列文
從零開始了解Unity或Unreal Engine應用於VR軟體開發31

尚未有邦友留言

立即登入留言