Utility layer events propagated into the scene


so we updated our project to Babylon 5 and we encountered some problems.
After some time, I managed to isolate the issue, so here I am :slight_smile: :

If you open this playground with latest babylon and click on the sphere, you’ll see a console log click event emitted on the scene

If you switch to version 4, this is no longer true.

Does anyone know whether this is a bug or a feature?

If it’s a feature, how can I ignore the scene pointer events when a mesh in utility layer was picked in babylon 5?

I have some ideas, but I would love to hear from the experts :scientist:


1 Like

let me add @PolygonalSun our input expert to the thread

So from what I can see, clicking on the sphere will return picking information that shows either a hit on the ground if your cursor is over the ground mesh or null if it’s not. The sphere is not pickable through scene.onPointerObservable so that’s a at least a good sign. As far as why there’s a behavior change, I’m not sure. I’ll have to investigate and see what’s happening.

Thanks! Maybe I’ll just provide some extra information why we need this:

We use the utility layer to draw some control points on the scene:

  • clicking on the scene ground creates a new point (that’s why we listen to scene.onPointerObservable).
  • clicking on the point removes the point (we use ActionManager for that).

This worked nicely in version 4.
In version 5, when I click on the point, it will get removed, but a new point will be created immediately after that :slight_smile:

We also have problems with PointerDragBehavior on these points, but I suspect the root cause is the same.

@PolygonalSun sorry to bother, but do you have any news here?
Just wanted to know whether you guys are going to change it back to original behavior, or I’ll just deal with the new one somehow :construction_worker_man:


Hey @MichalZr,

Sorry about the delay in response. I haven’t been able figure out the root cause on this one. As far as I’ve found whatever caused this change in behavior has been happened during one of the early 5.0 alpha pushes (prior to our repo refactor). I’ll keep digging and once I have something, I’ll let you know.