Decals with arms in the way

I’m trying to put decals around an avatar’s torso via mouse-click. It works well except when I’m clicking on the sides and the arms are in the way.

What I’d like is for arms to be ignored. So if you click on an arm it’ll process the click on the torso underneath it and lay the decal over the torso only.

Does anyone know the best way to do this? I think maybe splitting the mesh up into body and arms will work, but I’m trying to see if there’s a way without having to split up the mesh.

Is the arms a separate mesh? If yes then just set arms isPickable to false

If it is one single mesh then it is a bit trickier. You can really on scene.multiPick to get all pick points

I think multiPick only returns picks on different meshes, not within the one mesh.

You can see here with the torus https://www.babylonjs-playground.com/#6AO3Z#2 Ray would intersect torus a few times, but multiPick just returns 1 result

Oh yeah rats… I can change that behavior if you need

no its all good.
I’m just going to separate into submeshes. For my problem it looks like submeshes is a more practical solution anyway

1 Like