How to make mesh material fire like traffic light

Hello guys,
I have function Blink() and stopBlink() and I can activate blink between red and black.
I want my red color fire like trafic light
any function ?

Best regards


You could simply lerp the color or use an animation:

@sebavan I animate my blink button, the problem is that my button is red so I want when I blink it the red sunshine more like trafic lights like this, the green light fire

I am sorry I do not understand what you are trying to achieve :frowning:

If it is the glow effect, you could take a look at the glow layer in the doc.

I got you fam. Give me a second.

ok here is the base for a test example:

Ill get it blinking for you now.

Now to add the glow layer.

:slight_smile: BJS is awesome… that took all of like 15 mins which included me getting up to reheat my coffee…


@Pryme8 thank u so much it helps me but I have a problem :stuck_out_tongue:

I import three meshes from blender (they have the same material).
when I use mesh.material.emissiveColor= BABYLON.Color3.Red() I see that the 3 meshes blinks in the same time, I thought that because of object in JS passing by reference, so I recreate new material of each of my imported meshes (new materials) in order to avoid that they blink in the same time.
is this the best solution ?

thank you

can you make a demo scene?

I bet its because they are instances or clones. Or it might be that they are a single mesh? Im not sure id have to see what you got going on.

1 Like