changing material

Hi,

When I hit a spider object with a bullet it has a border around the outside as defined in the material. I use the line

rend.material.shader=shader2;

This works fine, so when my bullet hits the spider the spider outlines in a certain colour which shows the spiders being shot.

my problem is, when i build the game and run the exe it colours the whole of the spider in one colour…

Any ideas why this would happen?

Dont know if its related to this problem i’m having but when i compile it says
Shader error in ‘Hidden/NFAA’: Compiled shader code uses too many instruction slots (112). Max. allowed by the target (ps_2_0) is 96. at line 1 (on d3d9)

thanks

2d:)

if it helps it swaps between these 2 shaders
shader1=Shader.Find(“Legacy Shaders/Bumped Specular”);
shader2=Shader.Find(“Toon/Lit Outline”);

i found out it doesnt include it if your trying to access it from code
I had to add the shader in Edit Menu/Project Settings/Graphics