SvenFrankson Posted September 27, 2017 Share Posted September 27, 2017 Hi, I'm currently trying to convert some input code to observer/observables. Here's a playground : https://www.babylonjs-playground.com/#XCPP9Y#259 When clicking in the scene, the ground color is randomly changed. Is there a built-in way in the observable design to avoid triggering the scene pointer observer when triggering the gui pointer observer ? (ie : the ground should not change color when the clic hits the gui button) If not, can we pick which observer we want to be triggered first ? So we can share some data accross the observer to abort (like skipNextObserver, but on a wider scope) If not, it seems the GUI observer is triggered first. Can we rely on this ? Thanks a lot for your inputs ! Have a nice day, Note : As well... It seems "scene pickObservable" already performs some picking in the scene. Is there a way to avoid this behaviour ? (in the case we want to do the picking with another predicate). Thanks ! Quote Link to comment Share on other sites More sharing options...
adam Posted September 27, 2017 Share Posted September 27, 2017 You are dealing with two different observables. I'm pretty sure this is not possible. EDIT: I was wrong: https://github.com/BabylonJS/Babylon.js/blob/master/gui/src/advancedDynamicTexture.ts#L359 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 27, 2017 Share Posted September 27, 2017 Hey! So the button must block the pointer observer. It is a bug (fix will be deployed in a couple of minutes) I do not see a pickObservable on scene but perhaps you may want to check the default predicate and change them (like scene.pointerMovePredicate or scene.pointerDownPredicate) SvenFrankson and adam 2 Quote Link to comment Share on other sites More sharing options...
SvenFrankson Posted September 27, 2017 Author Share Posted September 27, 2017 Thanks for the reactivity, once again ! And glad to see that non-compliance with my use-case can qualify as a bug ^^ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.