Monster shadow

VIDEO

Unity Sprite Swap! The perfect 2D workflow

Description:
In this episode, I show you the new Unity sprite swap feature which allows easily swapping out sprites. This can be used for full units, armor sets and even mouths/eyes for dialogue systems. This is the 2nd and final part of this series. Part 1 can be found here: https://youtu.be/vLDK0eHwsho Example PSB: https://bit.ly/3v7xH6R PSD to PSB: https://www.imageconvert.org/psd-to-psb Please note: Check to ensure your layers all converted properly. You may need to flatten later styles. ========= 🔔 SUBSCRIBE: https://bit.ly/3eqG1Z6 🗨️ DISCORD: https://discord.gg/GqeHHnhHpz ✅ MORE TUTORIALS: https://www.youtube.com/tarodev
ADD A COMMENT

Kevin Scaglioni
Hey dude, I just wanted to say that these 2 videos are awesome. I don't know how many hours ive spent on YouTube and unity forums to find what you perfectly summarised in 10 minutes. My current workflow is trash and I'll be implementing this immediately. Thanks heaps
Tarodev
Ahhh, I'm so glad this helped you. I feel like I put so much love into these 2 videos, released them... and they just sat there.
dm kataurov
Great video! Thank you! It would be great to watch a video about Sprite Library.
SH
Sadly, In Unity 2021.1 (and Animation 6.0) thay have updated the flow on how to work with Sprite Swap. By using Sprite Library Asset.
Tarodev
As far as I know, there are two ways to utilize sprite swap, the way I've shown and manually via creating a library. By the way this method also uses a sprite library behind the scenes (you can see it when you expand your psb files).
David Ruttan
Did you make son of a witch?
Deviken Games
this channel will become one of the best ,you are doing an amazing job sir,keep going
Beard or Die
Great video and very happy to see usage of new packages with a sensible, practical workflow. Thank you.
Виктор Курбатов
Thank you. Good unity tutorial
MadLibberator
Changing one part at a time from the bandit to the orc looked he was transforming int the hulk. Good stuff mate!
NarkoPraxis
Extremely useful! Now I just need to figure out how to do this for a raster image file...
NarkoPraxis
@Tarodev oooh. Putting this on the queue of "things to do after I find a not gross AI implementation" 😂
Tarodev
You can use sprite swap without PSB importer. Just manually create a 'sprite library asset' and add a 'sprite resolver' on a component with a sprite render and bobs your uncle
sayed safwan
Very Useful.
SEE ALL COMMENTS


Transcript:

in the last episode i showed you how to import rig and animate using ik in this
video i'll go over the experimental sprite swap feature to truly boost your
2d development productivity alright let's get sprite swapping
head back into your sprite editor and click the skinning editor
we'll begin by adding categories for the sprites these must be unique but can be
reused across multiple sprouts for example we only need one head
category which can be used across both the orc and bandit
[Music] while you sit there watching me
frantically type be useful and hit the subscribe button
[Music] now we need to assign labels to the
sprites these will be the same unit wide for example i'll label all of my banded
pieces bandit and all of my orc pieces awk
ply your changes and exit the editor as you can see unity has removed all
duplicates of each category leaving just one of each
this is a bit of a weird byproduct but it makes sense in a weird way
it would be nice if it removed the empty folders and put them in a generically
named folder but oh well you can now click your sprites and change them using
the sprite resolver [Music]
to change the spreads at runtime create a new c-sharp script called outfitter or
whatever tickles you pick off in awake we'll grab all of the child
sprite resolvers i'll set up a unit type enum and switch
the current type when we press spacebar to change the outfit we'll loop our
resolvers and change the label currently being shown to the new unit type
take note the unit type enum names match the category names i set earlier in the
skinning editor attach the script to the unit and then
hit play we can now toggle between our bandit and
awk labels you'll obviously require more advanced
swap logic in your game but you get the point
but what if one of your units has an additional sprite like a helmet for my
orc this will create a weird result when
changing to a unit without that category this can be easily fixed by checking if
a label exists for the category if not disable the object
fantastic you now have an incredibly flexible 2d workflow for your game
thank me by subscribing to my channel and i'll see you in the next video