Hello, I’m relatively new to working with Sprites, and I’m creating a retro 2D sprite hockey game. Currently, I have three idle sprites combined into a flipbook. The helmet and jersey are white, while the skin is a natural tone. The flipbook works perfectly, and I’m using the Paper2D default class.
In this class, under the Sprite component, I’ve set my flipbook as the source, and everything works fine so far. There is a material assigned to Element 0 by default.
What I’m trying to figure out is how to dynamically set the colors for the jersey and helmet. I’d like to avoid having to create a unique sprite for every color combination. I’ve already created a material that masks the jersey and helmet areas, allowing me to change their colors (e.g., red jersey, blue helmet, normal skin tone) on a single sprite.
The issue is that since each of my three idle sprites is slightly different, the same material can’t automatically apply to all of them when assigned to Element 0 in the blueprint class. I can create a unique material for each idle sprite, but since they’re different, each material would need its own masking setup. I’m also considering using material instances to streamline this.
What I’d like to know is:
- How can I dynamically update the material based on the sprite currently being used in the flipbook?
- Is this the best approach? I’d prefer to avoid using something like an On Tick event, as I imagine it would be performance-heavy.
The only alternative I can think of is creating multiple copies of each sprite state with different colors, which would require separate flipbooks and a lot of redundant assets. I’d really like to avoid that if possible.
Any advice or suggestions would be greatly appreciated!