Highlight Layer issue with crosshair

Hello,
I’ve been playing around a bit with mesh picking and I seem to have it correctly working with a crude approach. I have a crosshair in my scene which I use to pick the mesh (rocks in the particular scene) and look around. When I pick a rock, I add it to a highlight layer (defined on line 52) but something weird happens to the crosshair and it seems like it gets added to the highlight layer as well even though I don’t explicitly do that. Why is this happening?

Line 176-210 is where the mesh picking happens. Line 305-349 is where I create the reticule.

Use W,A,S,D to move. Click and drag to look around. Press ‘E’ while pointing towards a rock to pick it up.

to be honest, I’m not 100% sure of the method used (from a user/UX perspective) but for your issue I quickly found this very simple go-around that seems to work.
Simply add:
hl.addExcludedMesh(reticule);
on line 202 (after adding others to hl)

3 Likes