So I have Intro in my game and there is a car driving and after some time it stops. The thing is, lights on the car are on (Emission). So of course when car stops, you turn off the lights, so I need my lights to turn off (Emission).
Here how it looks like on my car - Imgur: The magic of the Internet
So I need this emission to turn black exactly when the Audio Source Sound turns off the car.
public Material material;
void Start{
material.DisableKeyword("_EMISSION");
}
void Update{
material.EnableKeyword("_EMISSION");
}
To enable emission at a specific time:
void Start{
material.DisableKeyword("_EMISSION")
}
void Update{
if (trigger) {
material.EnableKeyword("_EMISSION")
{
}
Put Emission on and deselect the material before play testing.