Add mesh to two different highlight layers

Hi everyone,

First time posting here so I hope I do it the right way.

So here is the problem I have. I want to highlight a mesh if I select it and highlight it differently if I hover over it. And of course, a selected mesh can be hovered and both highlights should be somehow visible, the hover highlight slightly dominant.

Here is a playground with the example: Babylon.js Playground

The problem is when I’m adding the second highlight (red), the first one (blue) fills the mesh instead of highlighting it. Is this behavior intentional? Thank you all in advance.

Adding @sebavan

Yup you can unfortunately not highlight the same mesh twice. Maybe you could use color code instead?

Thanks for the fast reply. What do you mean about using color code? Sorry for the dummy question, I’m quite new to Babylon.

let s say highlight in red for hover green for selected and a mix so yellow for red and green ? (I am super dumb with UX and colors so you should definitely pick better :slight_smile: but you get the idea)

1 Like