I have a TextureRect node, and I need to change it's color dinamicaly via Shaders.

I have used the method 2 of this tutorial

Each TextureRect has an export var called color. When "red" is selected, the TextureRect becomes red, when "blue", it becomes blue, and so on.

However, my scene has multiple instances of the same TextureRect, so when I change the color of one, they are all affected.

It might important to note that I am using Godot 3.6, and the textures aren't png, but rather svg files. I also tried using duplicate() to avoid resource sharing between the instances, but it didn't worked too.

    UpsetChicken why dont you set the texture to uniq? Right click on it on the asset that it has and make unique or something

      kuligs2 Thanks for the tip. I tried doing that and unfortunately I got no luck.

      Today I run an experiment however: my texture is red(original texture), and I made it "turn" into the same red just because.
      Results: the texture output was white!
      So, it is mixing/blending the colors in some way. I also thought that maybe the code is making the texture's color "sum" the values somehow. e.g.: rgb (255, 05, 02) adds itself so it becomes rgb (510, 10, 04), so it caps and becomes white IDK

        If you want to change the color using the modulate property, use an all-white texture image.

        Or you can leave the modulate property alone, and load an image file into the texture property.

        UpsetChicken Ok, so, update:

        I figured out why they changed to white: I'm stupid.
        I was using Color() instead of Color8().

        BUT

        I still don't know why the texture changes affect all instanced textures instead of a single one.

          UpsetChicken
          I DID IT!

          I used duplicate() and boom, they all change their colors individualy.

          Thanks for the hand, man!