Mesh Intersection Event

This is similar to a question I had about collisions. I know the mesh intersect can be used for “triggers”, where I can detect a mesh entering another mesh. The playground examples from the docs here: Mesh Intersections | Babylon.js Documentation uses

scene.registerBeforeRender

This works, but it also seems excessive if I just wanted to check an initial intersection. Is there a more efficient way to detect this intersection without having to check every frame? I suppose this is more of a general question about detecting one-off events like this.

You have to check it on every frame until you found it. Then you can simply unregister your function to avoid additional unnecessary checks

2 Likes

Thank you, I’ll do that.