- Home /
Replace a sprite by another in every game object using it
I have a sprite which is referenced several times in my project (prefabs, tilegrids, images, etc). I want to replace this sprite by a new one in every place that references the old one. Doing this manually would be very tedious and I might also miss one reference, which could be annoying.
Is there a simple way to achieve this operation in Unity?
I was expecting something like right-clicking on the asset and then selecting a 'redefine sprite' option or maybe another option in the sprite's "import settings" but i cannot find anything.
to the best of my knowledge this must be done manually. it's one thing to make an override to a prefab which would go to the whole, but if each item is referencing a single sprite, you'd need to do it manually.
Alternatively you could open the sprite itself and "change" what is rendered as a sprite, you'd bassically just be adjusting the base sprite itself and that would change what they reference. I believe that may work but it also may have some unintended consequences.
Answer by RustyCrow · Sep 11, 2019 at 01:39 AM
hmm, cant you just save the new sprite using the name of the old sprite, which should overwrite/update the sprite on all the stuff using it.
I was expecting a cleaner solution but this seems to work all right as long as you are not using a "$$anonymous$$ultiple" Sprite mode and the format is exactly the same for the two sprites. Thank you for your help.
This should work regardless of mode. I think the idea of this type of system insted of a dedicated option, is to make changes as smooth as possible.
The work flow is simplified this way, just open the sprite in a editor and do the changes , save/overwrite and its ready to go in unity.
GL on you project buddy
Your answer
Follow this Question
Related Questions
loading sprite from atlas in script 4 Answers
How change sprite animation texture?? 2 Answers
Unity Adds Antialiasing to Texture 2 Answers
Sprites with Mipmaps Vibration Effect on Animations Problem 0 Answers
Tilemap: Resizing Tiles? 1 Answer