I see, yeah that's a good question. There are two ways to do that.
If you're doing it through the editor, when you right click on the property where the resource is assigned, there is an option called "Make Unique".
If you would prefer to do this in script, resources have a method called .duplicate()
, which acts just like .instance() for scenes, and .new() for objects. But be mindful some script allocated and instanced resources have to be unloaded on exit, using .free()
So watch out for that.
A example of code might look like this for a FixedMaterial as a resource.
var my_resource = preload("res://my_shader.tres").duplicate()
# Some change...
my_resource.set_parameter(FixedMaterial.PARAM_DIFFUSE, Color(0,1,1,1))
my_mesh.set_material_override(my_resource)