Replace color in specific sections in sprite

Hello!

I have some sprites that look exactly the same, except for the colouring. So far, I have made an atlas of the sprites, coloured them white, and the set the color in SpriteRenderer to match the original illustration. I feel that I am doing a lot of extra work for this, and am wondering if you guys have any tips of how to achieve this in a more efficient way.

For example, I have two horses. They have the exact same vectors, except for the different colors. Look at horse-pink.png and horse-yellow-green.png

I want to do this more efficient in order to have less amount of textures in the game, to make the build size smaller. Maybe there is another solution to this that I am not thinking of?

Thank you for your help!

BR
Arthur


Divide your sprite into parts depending on their colors, like this:
3024709--226071--horse.png
Set sprite mode as multiple, cut these two elements into two separate sprites in sprite editor.
In your scene place them one on top the other and connect them by parenting.
Now you can recolor each of them independently.
This is the easiest way.
If you want to use shaders for that, then you should read this thread: Link

2 Likes

Thank you for your answer 1Piotrek1. That is how I thought I was gonna do, and it feels better to have some confirmation that you thought of the same solution :slight_smile: