Fading out dead enemy models

Hi everyone,

ive made a script to destroy enemies in a game, they are robots that fly into pieces when you shoot them. I’ve also got a script to remove the pieces after X seconds, but what id rather do is fade them, as many FPS games do with dead enemies. Anyone help with the method for this??

Cheers,

Will

What you need to do is: first change the material’s shader into one that supports transparency. Then decrease material color’s alpha over time to make it fade out.

Material.Shader, Material.color and Shader.Find are your friends here.