GodotVR / godot_oculus_mobile

Godot Oculus mobile drivers (Oculus Go / Oculus Quest)
MIT License
170 stars 34 forks source link

Detect Quest as Platform #77

Closed SoapSpangledGames closed 4 years ago

SoapSpangledGames commented 4 years ago

When testing and debugging, I have code paths that are enabled when running on my PC and on my Android tablet, and different code paths that are enabled when running on the Quest. Is there a way to differentiate between the two platforms?

NeoSpark314 commented 4 years ago

One potential solution for this is to set a global variable when you successfully initialized the "OVRMobile" ARVR interface as this will only be successful on the quest. But there are probably other ways too like calling OS.get_name()

SoapSpangledGames commented 4 years ago

OS.get_name() was my first thought, too, and would have been ideal, but it returns "Android" on the Quest. Not seeing the forest for the trees, though, I completely overlooked using OVRMobile as a determinant.

Thank you.

NeoSpark314 commented 4 years ago

glad to help