Hightlight.addMesh() -ERROR TypeError: Cannot read properties of undefined (reading 'add')

Hi,

I am working on an web application (angular and babylonjs) that will simplify my work and I get an error when I try to hightlight a mesh when I hower on it. Interest thing is that when I “console.log (hightlight)” is not undefined , but it doesen’t work properly.
It’s not worth it to provide a palyground because in playground it works.
I wil provide some screenshots.



I’m kind of dummy at programming, but I’m doing my best.
I searched on google, but nothing related to this topic

Is listaStalpi mesh array?

Hey,
I don’t know what you did wrong, but I would use actionManager for hover instead

because onPointerMove is continuous running :roll_eyes:

1 Like

Yes, is this meshes that I hower on, on scene.

Are you sure i is always of type mesh? is it possible you are trying to add a different type of node? can you log the class name of i and make sure it is Mesh?


So, that’s a no

InstancedMesh (not of type Mesh but AbstractMesh) is missing certain properties to work correctly with a highlight layer.

More about it here - Why can't I add an InstancedMesh to HighlightLayer