Changing Material in Animation

I have a light Bulb that goes off eventually through Animation. It has a Illuminated Material, I need to change the Material when the light goes off in Animation. How to do it?

I have both the Illuminated and off materials.

@ddulshan Well, five years later, but here’s finally an answer.

  1. In your animation timeline, add the property “Mesh Renderer” → “Material Reference.”
  2. (optional) You may need to pull your “Project” tab into a new window so you can see both your list of materials and your animation timeline at the same time.
  3. Click and drag the material you want from your list and drop it in the animation timeline.

Hopefully you figured something out and weren’t trapped in developer limbo all this time, but I thought I would post in case anyone else has a similar question.

1 Like
  1. start your animation

  2. change your material using this

    if( renderer.material == material1 ) {
    renderer.material = material2;
    }

    else {
    renderer.material = material1;

    }