Search Unity

Question 2D Spritesheet management

Discussion in '2D' started by QueenRosa, May 10, 2023.

  1. QueenRosa

    QueenRosa

    Joined:
    May 10, 2023
    Posts:
    30
    Im new to unity and gamedev. and I’m trying to figure out the best way to handle spritesheets. My player character is going to have a lot of color variations with different patterns since it’s an animal. which means several recolors of the same sprite including walking, sitting, and everything else animations probably totaling close to 200 animations just for the player character which I hope isn’t too ridiculous

    to keep it organized, I am just not sure if I should make a separate spritesheet for each color or keep everything in one giant image. Also, if i did separate the spritesheet, how would I go about putting multiple spritesheets in the player game object? Just wondering the best route to go. Thanks.
     
  2. Lancival

    Lancival

    Joined:
    Oct 23, 2018
    Posts:
    2
    Instead of having multiple copies of the same sprites in different colors, you may want to look into using a shader, which can modify how your sprites look at run time. For example, the Replace Color Node from Shader Graph would allow you to recolor your sprites: https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Replace-Color-Node.html. With such a shader, you could create multiple materials that recolor to different color palettes, so that you only need one spritesheet.

    However, if using a shader is not feasible for some reason, I would recomend separating them into different spritesheets. That way, if you decide to tweak one of the color variations, you can replace a specific file corresponding to that color instead of editing a sheet with all of the sprites. If you're using a version control system (which you should be), this would also allow you to easily revert changes to just one color variation. Finally, assuming you're using Unity's animation system, having the sprites on different spritesheets shouldn't be a problem, you can drag & drop sprites from any spritesheet into any animation clip.
     
    Last edited: May 12, 2023