Sign in to follow this  

OnPointerOverTrigger Triggers through other meshes

Recommended Posts

I have a group of meshes that have OnPointerOverTrigger events. 

When I mouse over them the event triggers. 

However, when I mouse over them while they are behind another object that has no events, the OnPointerOverTrigger still triggers.

Is there a simple way to make OnPointerOverTrigger not trigger when the mesh is behind another mesh?

Share this post

Link to post
Share on other sites

Hello !

by default the scene uses this predicate to check meshes for triggers:

scene.pointerMovePredicate = function(mesh) {
return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled() && (this.constantlyUpdateMeshUnderPointer || (mesh.actionManager !== null && mesh.actionManager !== undefined);

Feel free to update it to remove the actionManager check: this way all meshes with isPickable will process the onPointerOver and you will get what you need ;)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.