Technology: Unity + Meta Quest

by Suellen de Salles


Can we place things in the real world?

Yes, once we have plane detection script running, we can place things in world where the planes are detected and a raycast is hitted by the player.

How it behavior?

First it is necessary to have a plane detection of the environment, then it is possible to place items in world where the player hits/interact on a plane detected. The object is placed in the hitted position and rotation, and stays in that virtual environment.


Tutorial

  1. Create new scene

  2. Place the following building blocks: Passthrough, Camera Rig, Controller Tracking

  3. Remove existing camera

  4. Create an empty object, in this case called RaycastPlacement, and place the following component: Environment Raycast Manager and Environment Depth Manager

    1. Environment Raycast Manager : Responsible to fire a raycast and get the first intersection point
    2. Environment Depth Manager : Responsible to generate and manage depth from the real environment
  5. Update or Install Unity OpenXR Meta

  6. Create a script to handle raycast and prefab placement

    https://github.com/Elixr-Simulations/wave-tech-demo/blob/test/placeobjectsVR/Assets/_Project/Scripts/Runtime/RaycastObjectPlacement.cs

  7. Attach the script to the RaycastPlacement object and set the references

    image.png

  8. PENDING: Create Android build profile and test the apk

Blocking: Run Device is greyed

image.png