How do I change my material's shader property at runtime

171 Views Asked by At

I have a material whose shader has a opacity property which I want to change at runtime. How do I get the reference to that property.

enter image description here

1

There are 1 best solutions below

1
On BEST ANSWER

This is done via Material.SetFloat.

You'll need to use the actual property reference name as key, not the Inspector display name, e.g.

enter image description here