Blocking actionManager events (solved)

Hello community,

I’m using actionManager for mesh OnPointerOverTrigger events. I have meshes in front of and behind a wall.

Is there any way for the wall to block events on meshes that are behind it?

I tried putting an empty function on a wall OnPointerOverTrigger event but it is still triggering the one behind it. I looked through the docs for something like preventDefault() but didn’t see one for actionManager.

Did I miss something?

Thanks,
The Skrapper

Howdy!

You can always implement a predicate as described here:
https://doc.babylonjs.com/how_to/how_to_use_actions#how-to-use-actions
It’s a simple function, returning true when it should trigger and false when not. You can check the distance to both objects and see if the wall is closer. If it does - don’t trigger the action.

1 Like

Thanks for the ideas RaananW. They got me into researching some cool things.

I think this was actually working OK and I was stupidly testing the wrong wall.

My empty wall function seems to be grabbing the event now.

Thanks again though.

Skrapps