Create an XR application in Unity, for both HTC Vive Focus Plus and Oculus Quest.
XR Application with Unity

Create an XR application in Unity, for both HTC Vive Focus Plus and Oculus Quest.

No alt text provided for this image

Prepare XR Project. 

1.    Open Package Manager and install/update the following;

a.    Oculus XR Plugin

b.    XR Interaction Toolkit

c.     XR Plugin Management

No alt text provided for this image

 2.    Register HTC Vive tools into your project by editing “Packages/manifest.json” file.

Follow this link to get scopedRegistry information: https://developer.vive.com/resources/vive-wave/sdk/320/vive-wave-xr-plugin/vive-registry/

No alt text provided for this image

3.    After editing manifest.json, refresh your package manager, and open “My Registries”.

No alt text provided for this image

4.    install “Vive Wave XR Plugin”.

5.    Open Build Settings and Switch to Android Platform.

6.    After Switching to Android platform, there is a possibility that “WaveXRPlayerSettingsConfigDialog” will appear. Select “Accept All”.



Prepare Simple XR Scene.

Note: Make sure you have “Prepare XR project” before start taking the following steps.

1.    After preparing XR Project.

2.    Open a new scene.

3.    Right click in Hierarchy, find XR, and select “Stationary XR Rig”. This will prepare “Main Camera” for XR.

No alt text provided for this image

4.    Look for “Main Camera” inside “XR Rig” GameObject, and add “Tracked Pose Driver” as new component, provide by the “XR Interaction toolkit”. Note: Please keep both “Tracked Pose Driver” components shown in this image.

No alt text provided for this image

 5.    Select GameObject named “XR Rig” and add “Locomotion System” as new component.

6.    The Locomotion System requires a reference of XR Rig script, so apply the XR Rig script attached to the XR Rig GameObject.

No alt text provided for this image

7.    Expend XR Rig GameObject and find the “LeftHand Controller” and the “RightHand Controller” GameObjects.

8.    RemoveXR Controller (Action-based)” component from both controllers.

No alt text provided for this image

9.    AddXR Controller (Device-based)” as new component.

No alt text provided for this image

10. Create an empty GameObject as the Child of “LeftHand Controller” and the “RightHand Controller”. Rename the empty GameObject as “ModelTransform”.

No alt text provided for this image

 11. Select the “LeftHand Controller” GameObject and give the “ModelTransform” as the reference in the “XR Controller (Device-based)”. Do the same for “RightHand Controller”.

12. Give a reference of anyhand models prefab” in “Model Prefab” field found in both Left and Right “XR Controller (Device-based)”.

13. Also make sure the “Controller Nodes” Field is defined correctly in both “XR Controller (Device-based)”.

No alt text provided for this image

14. Apply Sphere Collider components to both Controllers’ GameObject. Make sure to check “Is Trigger” and apply the Radius accordingly.

No alt text provided for this image

15. Create a Plane and a Cube. Place them in the scene accordingly.

16. AttachXR Grab Interactable” as the new component to the Cube. Make sure to resize the cube accordingly.

No alt text provided for this image

17. To create a XR interactable UI, right click in the Hierarchy, find XR, select “UI Canvas”.

No alt text provided for this image

18. Apply some buttons to the Canvas. Make sure to apply some OnClick events, to test UI interaction.



No alt text provided for this image

To make an APK for HTC Vive Focus Plus.

Note: Make sure you have “Prepare XR project” before start taking the following steps.

1.    Open “Project Settings” and find and select “Wave XR”. 

2.    Upon selecting Wave XR, “PlayerSettings Configure Dialog” Button will appear on the right side of the window, which will open a new window by the name of “WaveXRPlayerSettingsConfigDialog”, select “Accept all” and close the window.

No alt text provided for this image

3.    Go back to the “Project Settings” and find and expend “Wave XR”.

4.    Wave XR will be holding a sub-option by the name of “XRSDK”. Select XRSDK, and then select “Import Feature Custom Andorid Manifest” button appeared on the right side of the window.

No alt text provided for this image

5.    Again, go to the “Project Settings” find and select “XR Plugin Management”, which will show platforms on the right side of the Window.

6.    Select Android as the platform, and then in the Plug-in Provides, checkWaveXR” and uncheck the rest.

No alt text provided for this image

7.    Build and Run.




No alt text provided for this image

 To make an APK for Oculus Quest.

 Note: Make sure you have “Prepare XR project” before start taking the following steps.

 1.    Open “Project Settings” and find and select “XR Plugin Management”, which will show platforms on the right side of the Window. 

2.    Select Android as the platform, and then in the Plug-in Provides, checkOculus” and uncheck the rest.

No alt text provided for this image

3.    Make sure to delete the “AndroidManifest.xml” from Assets -> Plugins -> Android.

No alt text provided for this image

4.    Build and Run.


Credit to "6freedom" for allowing me to conduct this research.

Made with Unity 2019.4


Tim Stonesifer

Assistant Director for Media Technology

3 年

Hey, this is great, thanks! I'm going through this (this is the most up-to-date guide I've seen so far). However, I'm having trouble finding the LeftHand and RightHand model prefabs. Have any suggestions for where to find those? I've run a search in the assets, and only scripts come up.

回复

要查看或添加评论,请登录

Ammad Raza的更多文章

  • A Metaverse?!

    A Metaverse?!

    Metaverse A metaverse is a virtual universe where users can collaborate, communicate, trade, buy, sell, build, and…

  • Step By Step Guide To Merge Unity Build Application With Native iOS App.

    Step By Step Guide To Merge Unity Build Application With Native iOS App.

    At the time of this documentation, Xcode 12.5 and Unity 2019.

    1 条评论
  • Game Design Document Template

    Game Design Document Template

    Game Concept Game Genres: ( ) Platformer ( ) Shooter ( ) Fighting ( ) Beat’em up ( ) Survival ( ) Endless Runner ( )…

    4 条评论
  • The Virtual World

    The Virtual World

    What is virtualization? “Technically, virtualization is the creation of a virtual (rather than actual) version of…

  • Assassin’s Creed 2: Semiotic Analysis

    Assassin’s Creed 2: Semiotic Analysis

    The following document is based on the semiotic analysis that has been conducted on one of Ubisoft’s award winning…

    3 条评论

社区洞察

其他会员也浏览了