Hi all,
I’m trying to remove the default double click
exit event when on the VR view. I’ve been searching the docs and forums but can’t seem to find anything about it.
Many Thanks!
Hi all,
I’m trying to remove the default double click
exit event when on the VR view. I’ve been searching the docs and forums but can’t seem to find anything about it.
Many Thanks!
hey!
the code is here:
I could add an option to the VRExperienceHelper to disable the feature if you want
That will be cool, if there will be an option for it. Anyway I can just clear the observables to remove it for now.
Thanks!
Having the same issue with regular fullscreen, might be a good idea to add it there to if you are adding an option Deltakosh.
btw, is there a way I can list all that is added to observables for a particular object ? so I can find what to remove to only remove the “double click exit” trigger. Still wrapping my head around observables, so let me know if I should clearify, and sorry for hogging your threed praxxys :S
@praxxys.developer: Ok I will add an option: vrExperienceHelper.exitVROnDoubleTap = false
@Elk: What do you mean with fullscreen? Can you elaborate? For observers they can be found on observable.observers
I made a quick PG, and then i noticed that my code only run in stable and not in latest, so i guess I might be using some “deprecated” functionality with BABYLON.Tools.RequestFullscreen… ? Is there a better way to do this ?
https://playground.babylonjs.com/indexStable.html#JQ30DN
However it seems that the playground I set up works as expected (in stable) without the double click exiting, so I guess there is something else causing it to exit in my project.
Thanks for the tip on observable.observers, I will check it out.
@Deltakosh Thanks for that!
Hey @Elk,
No worries, also interested on your observables
question. May I ask what you did to remove the double click exit
feature specifically on the scene
observables? As I only did a scene.onPrePointerObservable.clear()
.
Yes I deprecated Tools.RequestFullscreen
in favor of engine.enterFullscreen()
Thanks for the info Deltakosh.
@praxxys.developer Just looked at this a little bit so far, but I found something like this to work for removing the first observer from a custom button for instence;
Btn.onPointerClickObservable.remove(Btn.onPointerClickObservable._observers[0]);
Probably not the cleanest way to do it, but hope this helps a bit.
Just avoid using _:
Btn.onPointerClickObservable.remove(Btn.onPointerClickObservable.observers[0]);
Thanks for the clearifying Deltakosh. I tried that first, but I seem to only get “undefined” back when I tried to console.log without accessing the _(private/protected?) “version”…
Should work Babylon.js Playground
I am on stable, and there it looks like it does not unfortunatly, but not a huge issue for me atm, so no worries. Thanks for the help.
Yep update is on Preview (you can definitely use it, it has the same quality bar as stable)