Unity Sprite Swap Feature

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
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
Info
Channel: Tarodev
Views: 33,408
Rating: undefined out of 5
Keywords: tarodev, unity, tutorial, sprite swap, 2d, unity 2d, skinning editor, 2d ik, 2d animation unity, game development, 2d sprites, inverse kinematics, game development unity
Id: wBGykdKd80w
Channel Id: undefined
Length: 2min 38sec (158 seconds)
Published: Fri Oct 15 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.