Welcome to The Desert
Objective: Enable Oculus pass-through feature & build a VR portal from my apartment to a virtual world & back
VR build Software: Unity 2020.3.19f1 and C# in Visual Studio
HMD: Oculus Quest 2
Date: 7-8th February 2022
Result
Notes: Could add more portals - making my apartment a hub to many different worlds. Some doors might not have a way back too.
Integrate MRTK to allow for hand interaction with GameObjects to pull portal doors open & close.
Process/Documentation Below
Features
Oculus pass-through feature
VR portal
On trigger play audio & animation
Pass-Through feature settings to enable
Portal Trigger Script
Notes:
- TargetTag string to assign Main Camera as collider
- doorAudioSource to assign when opening
- doorAnimator to assign to door opening animation upon player proximity to the door
- Upon trigger enter between maincamera(center eye anchor) with portal trigger box collider, play audio & fulfill ‘Opening’ parameter to initiate door opening animator
- Center eye anchor Rigidbody is kinematic to not be affected by other physical objects but register on trigger events
After assigning pass-through material for “insideportal” layers(layer 6), desert game objects no longer visible in editor mode.
Portal Script
Notes:
- “Target tag” string to assign to main Camera (Center eye anchor)
- Gameobject list to assign desert gameobjects to be visible only after entering portal space
- new layer integer to assign to as default layer(layer 0 in this case)
- OnTriggerEnter with main camera tag, change layer of each desert gameobject from insideportal(6) to new layer(assigned as 0 in inspector)