Changing material or texture on a Projector

I have been trying to find a way to change the material on my projectoir.

I have done everything I can think of from

proj.material.SetTexture( "_MainTex", newTex )

proj.material = newMaterial

proj.material.mainTexture = newTex

I just can't seem to figure it out.

any help would be great thank you

Look in the projector shader to see what the names of the properties are that you should change with SetTexture. (As I recall, in this case it's "_ShadowTex".)

As Eric5h5 said, this works great for me:

projector.material.SetTexture(“_ShadowTex”, texture);