Set the transparent/Cutout/VertexLit shader property

How do I set the transparent/Cutout/VertexLit shader property Alpha cutoff from code.

I have to have something like renderer.material.shader.alphaCutoff = myValue;
I tried things like:
renderer.material.SetFloat(“AlphaCutoff”, Random.Range(0.0f,1.0f));
But the shader property doesn’t seem to exist when I try to access it i code.

How do I get and set a shader property from code?

found the solution renderer.material.SetFloat(“_Cutoff”, myValue);
:slight_smile:

Hi, Do you now what to write and where? if you want cull off (2sided shader)

I have no problem making it work with the transparent/vertexlit shader using “Cull off” but I can’t get the transparent/cutout/vertexlit shader to display both sides.