Change material of a single prefab

I want to change the material of a prefab every time damage is equal 2, however this changes every single instance of the prefab.

This the script in the prefab

public Material[] materials;
public Renderer rend;

void start()

        rend = GetComponent<Renderer>();
        rend.enabled = true;

        damage = 1;
 void Update()
        if (damage == 2)
            rend.material = materials[0];

this one is the player’s script that instantiate the prefabs.

public Rigidbody ball;

 private void Shotter()
            if (Input.GetMouseButton(0) && ballSpeed< 50.0f)
                ballSpeed += 25.0f * Time.deltaTime;
                filler.fillAmount += 0.5f  * Time.deltaTime;

            if (Input.GetMouseButtonUp(0) && ballNumber < ballNumberLimit)

                Rigidbody ballInstance;
                ballInstance = Instantiate(ball, barrelEnd.position, barrelEnd.rotation) as Rigidbody;
                ballInstance.velocity = barrelEnd.forward * ballSpeed;
                ballSpeed = 0.0f;
                filler.fillAmount = 0.0f;
                ballNumber += 1;



I have a similar code and it works fine for me. Maybe try setting the prefab’s renderer to private? There is no need to expose it if you’re finding it through GetComponent and it might be the cause of your issue.