I’m liking the new 2D system, and I’d like to take advantage of some of the animation features along with mechanim. The problem though, is I can’t figure out how to update spritesheets. Say I already sliced up my original spritesheet, and created some animations with those sprites. What’s the best way to update that spritesheet’s texture without having to slice it all up again and recreate a bunch of animations? I really just want to replace the texture and have everything else stay the same.
I may be just missing something obvious, but any help would be appreciated.
Does anyone have any idea how to change a pre-existing sprites texture? It’s kind of a no-go with the new system if I can’t do that. I’m sure there’s a way, I’m probably just missing it.
I’ve been looking for the same answer, and I don’t think you can do this.
What I think you CAN do is import and slice up all your sprite sheets. Then create all your individual animations. Then create an Animator for one set of animations.
THEN, I think you’re able to re-use that Animator for other sets of animations. Or use it as a template to create new Animators. Or something.
If you can get the SpriteRenderer instance, you should be able to swap the sprite with the “sprite” property on the SpriteRenderer. I haven’t tried it, though.
I’m not actually trying to modify the sprite at runtime. Maybe I worded it strangely.
Say I have a sprite sliced up, and all it’s animations done. I now realize I want my sprite to have a hat so I need to modify the sprite sheet. What’s the best way to override an existing sprites texture without losing the slices and any animations it’s associated with? Dragging and dropping it into Unity just adds it as a new sprite with a 1 appended on the end.
That’ll work? Okay I’ll give that a go. Most stuff I read about Unity says to not move stuff or copy stuff outside the editor as it could break references.
Its ok if its raw media types like PNG, MP3, WAV, so on. FBX or model formats can get a bit tricky because its possible you changed the number of meshes or materials in the object - that can break references.
The slice data is kept in a hidden meta file for each sprite asset so if you overwrite the image it will still keep the slice data. Importing it into unity will overwrite all slice data.