Generic scene right click

Sorry for yet another question.

I know we can determine right clicks on GUI elements through onPointerDownObservable’s pointer-info, but it doesn’t look like we can do the same for the scene in general. scene.onPointerDown seems to be only for left-clicks. What would my best bet be for detecting a right click by the user anywhere in the scene? Not sure if this changes anything, but the mouse has been captured. Haven’t had any luck with conventional javascript/DOM detection.

you can read it from the event object
Check here: https://www.babylonjs-playground.com/#7CBW04#29
line 113

Thank-you so much! Only just started scouring the docs, didn’t know of the more generic onPointerObservable. Just what I needed.

2 Likes