User Tools

Site Tools


vr_unity

Steps for VR

  • Install editor (v 2021.3.) > Install
  • Add ‘Android Support + Open JDK + Android SDK and NDK Tools’ > Continue
  • Agree> Install
  • New Project > 3D (URP)

Setting up environment

  • Top right layout > Tall
  • Create scene, ‘Main scene’
  • Create > 3D object > Plane
  • Right click in project window
  • Create > material

Enable VR environment using oculus integration

Fun part – Hand tracking

  • Delete ‘main camera’
  • Create > 3D object> cube
  • Search in project ‘OculusInteractionSampleRig’
  • Drag ‘OculusInteractionSampleRig’ to scene
  • Select ‘OVRCameraRig’
  • Change Tracking Origin Type to ‘Floor Level’ and Tracking support to ‘Hands only’
  • Look for ‘Left/Right HandAnchor’ under ‘OVRCameraRig’

Grabbing Object Interactor

  • Add ‘HandGrabInteractor’ to both ‘HandInteractor’ under InputOVR
  • Select ‘R/L Hand’ drag ‘OVRGrabber’ to add elements in interactor
  • Check Parent Held Object or you will see some jumpiness when holding and object and moving your hands.
  • Add sphere collider to grab volume

Interactable

  • Add ‘rigidbody’ to the cube under add components for a cube.
  • Add ‘OVRGrabbable’

https://developer.android.com/tools/releases/platform-tools

vr_unity.txt · Last modified: 2024/06/29 14:23 by neil