UI Text - changing material instance

I have two UI Text instances, each one with a material attached to it. I would like to change a material’s property for a shader like:

[into a script attached to UI Text]
this.gameObject.GetComponent<Text>().material.SetFloat ("myValue", 0.5f);

This works but unfortunately it sets the float variable for ALL the UI Text instances. I would like to change it only for one UI Text instance. How can I achieve this?

if you’re using the same material for all of them then it will - you need to ensure that the one you are changing has a unique material and set that accordingly.