Different (scaled) bounds for pointer events than actual mesh

Hello, what is the best way to add a little bit bigger bounds for the actionmanager events? This is
my current approach: Creating two same meshes and scale one up with alpha=0

It is simpler and more effective to clone the first mesh, so both meshes share the same geometry - https://playground.babylonjs.com/#CU8IOA#3

2 Likes

Welcome aboard!

@labris is right to say that you will save memory by cloning the mesh. Now, if you want to use up a little more memory, you can make the selection process a little more efficient by using a low-resolution version of the hidden sphere: as it is hidden, the user will not see that it is not a perfect sphere.

You can set segments to 1:

It’s hardly a sphere, but it doesn’t matter. You could even use a cube instead… In a real scenario, you will probably have meshes other than spheres, but the same idea applies: use a lower resolution of your model for the selection mesh.

1 Like