I want to set alpha clipping in my material through script(URP),How can I set alpha clipping through script?(URP)

I want to set alpha clipping in my material through script (URP), but

material.SetInt( "_AlphaClipping" , 1 );

doesnt work!

It is a bit strange but you set the bool to enable Alpha Clipping with a float

material.SetFloat("_AlphaClip", 1);
material.SetFloat("_Cutoff", 0.5f);
material.EnableKeyword("_ALPHATEST_ON");

I doubt this will help @Windowser2 anymore as it’s been 9 months. I hope it helps somebody

Also, you need to add EnableKeyword("_ALPHATEST_ON").

It did help, thank you for this. Also @tylerjacksontdfa yes, you have to use it in order:

material.EnableKeyword("_ALPHATEST_ON");
material.SetFloat("_AlphaClip", 0);

When you want to set Alpha Clipping back to false, you need to:

material.DisableKeyword("_ALPHATEST_ON");