I am hoping that this is simple. In my playground I have green spheres that attach to the roof space, when you click the mouse. I would really like this action to happen when a key (say Ctrl) and the mouse is clicked. At present the spheres can be attached accidently if the mouse hovers over the roof space and the camera is rotated with the left mouse button.
So, having a combination of mouse click and key press should eliminate this accident.
I had tried this code earlier, before entering my query into the forum, and could not get it to work. But I gave it another shot with the code you provided.
Ideally, I think I would still like a key and mouse input, as I may need more functionality that the mouse alone cannot do. But having a right click function would be really handy.
I just this second entered the forum to say that I had solved my issue…I put it down to some bad coding I had in other parts of my project. So, maybe my code wasn’t bad after all (I’m sure it was).
And the scene.onKeyboardObservable looks interesting.
Thanks again.
And thanks again to Iabris, who steered me in the right direction.