Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Last active September 18, 2026 10:26
Show Gist options
  • Select an option

  • Save unitycoder/3962fcbb2130d7efa709dda3f116d0ca to your computer and use it in GitHub Desktop.

Select an option

Save unitycoder/3962fcbb2130d7efa709dda3f116d0ca to your computer and use it in GitHub Desktop.
Unity Oculus Quest Notes

How to make 3d object clickable

  • add "Tracked Device Physics Raycaster" to your main camera
  • then your 3d object reacts to vr selection ray (for example if it implements IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler)

how to make worldspace UI elements clickable (like buttons)

add "Tracked Device Graphic Raycaster" component to canvas

teleportation area doesnt work

can check what ray hits: Window > Analysis > XR Interaction Debugger

Probably its on wrong layer (in xr sample scenes, default layer is used)

Find: Teleport Interactor (under each hand, adjust Raycast mask)

meta quest link keeps failing every 2nd play? (need to kill ovr to reset)

It seems to be link connection alone that hangs, headset view is stuck on 180 view.

From OculusDebugTool.exe try: Video Codec: H.264 Sliced Encoding: Off Asynchronous Spacewarp: Disabled

Tip. You can also kill ovr from meta quest desktop app, settings/developer/crash button

server build keeps spamming "DllNotFoundException: OVRPlugin assembly: type: member:(null)

at (wrapper managed-to-native) OVRPlugin+OVRP_1_1_0.ovrp_GetInitialized()"

work around: rename meta.xr.mrutilitykit.dll to meta.xr.mrutilitykit.dllx in the server managed folder. But better if remove the package or asset in scene or project (Meta Immersive debugger or old OVR canvas).

if cannot connect from quest client to your server build

check what port server uses: sudo ss -uapn | grep vfserver (its probably 7777, which is wrong)

need to force it in running args: (newer NGO version has bool force arg method?) ./yourapp.x86_64 -port 55000

Oculus overlay keyboard is disabled, add 'oculus.software.overlay_keyboard' feature request to your Android manifest.

From OVRManager in scene:

MetaXRSimulator.exe - This application could not be started This application requires the Windows App Runtime Version 1.5 (MSIX package version >= 0.0.0.0)

run installer bat from C:\Program Files\MetaXRSimulator\v85.0\WindowsAppRuntime

world space UI tips

  • scale the CANVAS (not the elements!!), so canvas is 1000x600, but its scaled down.. instead of setting canvas to 3x2meters.

quest 3: cannot play on device (run on device in build settings is selected)

need to enable vr for Desktop platform also, even though you are in android or meta platform! (so playing happens through using link)

quest 3, application doesnt play in immersive VR (but shows in 2D screen)

  • install Meta Core SDK and apply all fixes

optimizations

view FPS info in standalone app

"primary trigger button not working!"

"detect if laserpointer ray is over UI button"

if (EventSystem.current.IsPointerOverGameObject()) return; if (EventSystem.current.currentSelectedGameObject != null) return; (note primary button sometimes switches to other hand!)

"Cannot play in editor with Link cable? (using oculus plugin from asset store, android platform)"

  • enable Oculus plugin for Desktop platform! (in project xr settings)

"If you're running games on the Quest device directly, you have to use forward rendering as neither the Quest or Quest 2 are powerful enough to use deferred rendering."

cannot enable developer mode in mobile

  • and verifying your account with google auth. doesnt make you verified
  • add your old fb account into https://accountscenter.meta.com/profiles/
  • add 2FA method (phone), then LOGOUT in mobile app and login again
  • restart oculus app then it shows enable dev button (instead of "get started")

build n run doesnt work? no device?

enable hand tracking for oculus pc desktop (link, air link)?

record oculus from pc

oculus doesnt run, gets stuck on OVR... ERROR (when selecting library path)

  • reinstall it again (or do repair install) for this user (problem is that it was installed to another user)

oculus airlink not pairing? (code dialog not appearing on desktop)

stop teleports going through walls

  • at TeleportTargetHandlerPhysical component, set physics layers that block ray

no teleport controls

  • enable LocomotionSampleSupport.cs in your scene

remove rotation toggle from teleport target

  • delete orientation gameobject inside "TeleportDestination" prefab
  • then fix null references where it tries to access that

teleport gets stuck (doesnt teleport)

  • dont press thumb sticks as button? or release thumb from touch to teleport

wrong floor height at start or after teleporting? (using locomotion controller)

  • disable character controller component
  • disable CharacterCameraConstraint component from player
  • remove line from LocomotionTeleport.cs: destPosition.y += character.height * 0.5f;

oculus plugin, screen keeps fading in some view angles?

  • comment out screenfade from the one script that uses it (see oculus screen fade component and who calls the static singleton)

oculus plugin, character controller head is too high or too low?

  • set 0,0,0 for Character Camera constraint component (those override and min,max values)
  • then set capsule size 1m, at 0.5m

unknown sources app not running full screen?

  • it doesnt have VR enabled in unity build
  • also doesnt show exit app then

enable disable developer mode

  • from the mobile app
  • settings, connect to headset, more settings: developer mode

quest 2, set 90hz

https://forum.unity.com/threads/90hz-for-quest-2.1006934/#post-6531572

OVRLibraryService.exe taking high cpu?

  • its downloading/installing some update

better hand tracking (dont hide if low confidence)

https://twitter.com/ShaneDoherty/status/1255469495608651784

lite oculus home version

https://www.reddit.com/r/oculus/comments/8uf1sm/oculushomeless_use_dash_without_home_20/

null ref errors after adding EventSystem in scene

  • assign CenterEyeAnchor as RayTransform in OVR input module
  • assign OVRGazePointer as Cursor in ovr input module

Cannot add EventSystem to scene

  • because Oculus SDK breaks it.. restart unity, create new scene, add eventsystem there
  • or copy it from oculus scenes UI.scene

Oculus Hub toolbar is too high (or low)

teleport not working (copied player from Locomotion scene)

  • copy SampleSupport gameobject also

localAvatar hands not visible or too far

  • need to be in correct order in hierarchy:
  • OVRPlayerController
    • OVRCameraRig
      • TrackingArea..
        • LocalAvatar..

optimize for quest

Oculus > Tools > OVR Performance Lint Tool, and it will suggest changes that might improve CPU/GPU in VR. https://forum.unity.com/threads/oculus-quests-framerate-oculus-gos-framerate-for-the-same-app.804471/#post-5352237

locomotion teleport moving backwards

  • disable character collider from player

teleport not working after made custom target?

  • null ref in NullReferenceException: Object reference not set to an instance of an object 12-12 11:05:31.609 26559 26573 E Unity : at LocomotionTeleport.DoTeleport ()
  • because removed rotation marker (just assing dummy empty object to it)

build, copying to device gets stuck?

  • restart device, or kill unity, or unpluck

teleport not working? (locomotion scene)

  • press thumbstick forward to show teleporter (instead of press click)
  • also had disabled character controller in player

teleport not working? (locomotion scene), shows red line

  • ray is probably hitting player, set walkable areas to different layer and set layermask in teleport target script inspector

hands not visible?

teleport locomotion issues

https://forum.unity.com/threads/oculus-integration-teleportation-not-working.642862/#post-5198525

BUILD SETTINGS

Texture compression

  • ASTC

cannot read files from sdcard

need to add runtime permissions manually: adb shell pm grant <package_name> android.permission.READ_EXTERNAL_STORAGE adb shell pm grant <package_name> android.permission.WRITE_EXTERNAL_STORAGE https://forums.oculusvr.com/developer/discussion/78412/accessing-local-files#latest

adb devices shows:

########### unauthorized Need to click allow in the device when you do first Build & Run. If doesnt appear, from Oculus mobile app, disable developer mode and enable again, then connect device to pc, click Always allow in the dialog popup.

optimization tips

https://developer.oculus.com/blog/down-the-rabbit-hole-w-oculus-quest-developer-best-practices-the-store/ https://developer.oculus.com/documentation/quest/latest/concepts/unity-perf/ https://www.reddit.com/r/oculus/comments/bay1im/optimizing_your_game_for_the_oculus_quest_14_tips/

  • use compressed textures
  • no overdraw
  • ztest helps (if big close objects get drawn first)
  • "resolve" means copying from fast gpu ram into system ram
  • "unresolve" means copying from system ram to gpu ram (slow)

https://www.youtube.com/watch?v=JvMQUz0g_Tk

Add Laser pointer for old OVR plugin (unity 2019.4)

  • add physics raycaster to OVRCameraRig
  • add UIHelpers prefab to scene
  • EventSystem, Assign Raytransform: RightHandAnchor
  • LaserPointer GO: Enable LineRenderer
  • Add OVRRaycaster into Canvas
  • https://www.youtube.com/watch?v=8fT478uopco
// get button press
void Update()
{
if (OVRInput.GetDown(OVRInput.Button.One))
{
Debug.Log("Pressed A");
}
}
https://developer.oculus.com/documentation/unity/unity-ovrinput/
> "java.net.UnknownHostException: Unable to resolve host "cdp.cloud.unity3d.com": No address associated with hostname"
no wifi enabled, but why it tries to connect in the first place?
> "UnauthorizedAccessException: Access to the path "/sdcard/Download/yourfile.asdf" is denied."
use android 9 API 28 (not latest), unity bug.
@unitycoder

Copy link
Copy Markdown
Author

setup correct camera height:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment