• 2D
  • I can't change the colour of my sprite

Hello ,

So I'm having this problem where I have Area2D as a parent Node and a Sprite and CollisionShape2D as it's children. I want to change the colour of my sprite so I click on the Area2D and try to change it's Modulate, but it is changing the colour of the CollisionShape rather than the Sprite. What can I do to change the colour of my sprite without reformatting the whole PNG?

Changing the modulate changes the sprite color for me, using the following node setup:

  • Area2D
  • * Sprite
  • * CollisionShape2D

I couldn't reproduce the issue in Godot 3.1 on Windows. The CollisionShape shouldn't change color or be affected the the modulate property, it should always be the same blue. Can you post a picture of the before and after of modulation? Also, does this issue happen in-game as well, or only in the Godot editor?

(Also, welcome to the forums!)

Thank you for welcoming me!

Here I have 2 pictures where, in the first one, the modulate is set to default white and in the second one it's changed to a bright orange

It looks like the collision shape changed it colour, while the sprite remained black. The script for the Spike (or Area2D) contains nothing but a signal func that has nothing assigned to it.

Any advice would be helpful, thanks in advance!

Try changing the modulate value of the Sprite node and not the parent?

Actually, that's the first thing i opted to do, but with unfortunate results; it stayed the same colour.

Is your sprite black? If so, that is why the modulation is not working. You will need to turn your sprite white for modulation to work, as you cannot modulate another color with black without it being black (or to put it another way: mixing a color with black will result in black). I'd recommend changing the sprite to white if you plan to modulate it to different colors, as then the modulate color will have the most effect.

I'm not sure why the CollisionShape is changing color though...

Right, so modulation in this case is multiplication of the color channels values. Multiplying 0 by anything is still 0.

Ooh I see... Makes sense... Thanks for answering me!