MAKE ORGANIC LEVELS!! Unity Sprite Shape

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so we've previously talked about how amazing tell maps are for quickly making 2d levels in unity well of course talents are only useful if you want everything to be on a fixed grid now sprite shapes on the other hand are set up in a very similar way to tile maps but instead of placing tiles on a grid the sprites will stretch and tile in order to follow a path this makes it super easy to create curves and more organic feeling objects as of making this video sprite shape is still in preview so features are still being moved around and added but it's definitely usable so let's have a look at how to start using it but first this video is sponsored by a skill share skill shares an online learning community with more than 23,000 quality classes on game development tech and more if for example you want to make your own card game in unity I really recommend you check out this awesome course on developing trading card battle systems this guide is made by vladimir imagine and teaches your everything from making your own card faces to implementing your cards in battle let's go see our membership gives you unlimited access to all classes for less than $10 a month so to get started simply click the link in the description and the first 500 people will receive their first two months for free now to take advantage of sprite shape we of course need some nice sprites that are set up in the right way these are the sprites that I will be using in this video you can download them using the link in the description they are made by the awesome mod mod who has a YouTube channel on creating beautiful pixel art so if you want to learn how to create your own pixel out sprites definitely check that out in fact he's made a video on creating this exact sprite sheet alright let's get started so the first thing that we need to do is of course to install sprite shape and it's currently available in a preview version using the package manager so let's go window and open up the package manager let's go under all and find the 2d sprite shape package and here we instantly hit install and that is all we need to do we can now use sprite shape in our project now I've already gone ahead and imported the sprites that we're going to be using in this video I've made sure to select all of them and set the pixels per unit to 16 the folder mode to point because we're using pixel art and I've also removed any kind of compression and the first type of sprite shape that we're going to be creating is an open-ended shape now open-ended shapes are great for stuff like flat platforms and creating these are super simple if I just take my platform sprite here you can see that it's just one unified spread there's no need to split it up into individual tiles using this system and I'll show you why in a sec but for now let's start by creating a sprite shape profile and we do this inside of the project window let's it create go under sprite shape profile let's start by creating a strip profile we'll name this profile something like flat platform and now we can see a bunch of different settings in our inspector here but when creating an open-ended shape there's not a lot of this that we need to adjust in fact for now we can just get away with adding our sprite so that's hit the plus sign under sprites and it's dragging all platform and we see this bright now gets displayed here now with this profile selected we can go to the hierarchy and hit create 2d object sprite shape and we've now created a sprite shape object based on a flat platform profile you can always change the profile over here and what this means is that we're actually ready to start editing our path to do this we go to the right and hit edit spline you can see that we now have these two points that we can drag out in any way that we'd like to you also notice that as soon as we do that our platform starts tiling and it doesn't do so in a very pretty way it simply repeats the entire platform one after another and that's not really what we want instead we would like to see that we have the end of the platform here then it simply repeats the middle part and then we have another end of the platform at the end to set this up we simply stop editing the spline we go select all platform sprite and let's open up the sprite editor and in here we can use the sprite editor to define the ends of our platform as well as the middle part and doing this is super easy we simply adjust the left and right side of our border so I'm gonna set this to something like 5 down here and I'm gonna do the same thing with the right side and now we can see that we've separated the ends of our platform from the center if we apply this and go back into unity we can see that immediately our platform tiles really nicely and if we go in and edit the spreadsheet ghin we can add more points if we simply press on the middle here and drag out we've now added a sharp corner point we can see that here the point mode is currently a sharp point where we go in a straight line from point to point we can also edit this to change it into a curve and here we can adjust the tangents to make it much smooth and nicer and if you don't want the attendance to be mirrored we can choose the last mode here where we can adjust the smoothness of each side individually but I simply want a smooth curve here so I'm gonna select that and let me just draw out a quick shape there we go so you can really see how easy it is to create your own shapes inside of the editor now we can stop editing this spine and at this point we can use it like any other object we can move it around we can scale it and rotate it however of course one thing that we probably want to do is add a Collider to our platform and doing this is actually super simple we simply hit add component and search for edge Collider 2d and then inside of our sprite shape controller we can go under Collider and select update Collider and right away we can see that our green line snaps right into place however of course it's currently in the center of our platform and we want to be able to stand on top of it so to change this we can adjust the offset of our Collider I'm gonna bump this up and that actually looks pretty decent we can also change the corner type to something like round and there we go we now have a Collider for a platform in fact if we were to just add some kind of rigid body into a scene I've gone it and created a bowl here that has the circle Collider supposed a rigidbody and hit play we can see that it works just fine awesome so that is how you can use open-ended shapes to create simple flat platforms but what if we wanted to create closed-ended objects that doesn't just allow us to create lines but actually closed-ended shapes I mean this is fine for platforms but what if we wanted to create larger ground elements now to do this we need to create another profile so inside of our project we'll go create sprite shape profile and this time I want to start with an empty profile let's name it something like ground and you can see that we get all of these same settings however this time we don't have a predefined range now range is basically just allow us to define what sprites we want to show when facing in what direction and for our first profile here we can see that we just have one large range that goes around in the entire circle so we always show the same sprite however for our ground we probably want to have some grass at the top some dirt on the sides some different kind of dirt at the bottom so to do this we actually need to create or ranges in order to create a range we of course hit create range and we then choose these start and end points of our range I'm gonna start this off at 45 and end it at negative 4 to 5 so this makes a 90 degree range I'm going to create another 90 degree range right after that simply by pressing that goes from negative 45 to negative 135 I'm gonna keep pressing here just controlling the numbers to make sure they are ok now we can see that we've created for different ranges and as we adjust this Margaret and go around we can add sprites for each one of them so at the top here I'm going to add a symbol top sprite and this is just some grass and some dirt I'm gonna be using tile 2 for this and as you can see that looks just fine then we get to the right-hand side here I want to be using another sprite so I'm gonna hit + and this is where sprite shape is a bit different than normal towel Maps because my instinct originally was to create a sprite that faced to the right but we actually don't want to do that for sprite shapes instead we actually still want to create a sprite that faces upwards as you can see here that's what we've done and the reason for this is that we don't need to rotate it sprite shape is going to rotate it for us in fact we can see that happening in this wheel spread shape is just constantly rotating our sprite so for the right one here we simply need to choose Tao 7 and we see now that it looks great for the bottom tile we're going to add another one and this is going to be tile 10 again this isn't made to point downwards it still points upwards but it looks different and finally for the left-hand side here I'm going to add in tile 5 so now we can see that this bright will change accordingly as we go round and just to show you this in action let's try and create a sprite shape object based on this profile that's selected let's go to hierarchy and hit create let's like 2d object and sprite shape and you'll notice that it detects that we have multiple sprites in here and therefore it's gone ahead and disabled open-ended but if it hasn't done so you can always make sure to check that box and right away we can see the effect of our changes if we go in and edit the spline here no matter what we do it's always going to display the appropriate sprite depending on which direction the sprite is facing pretty cool of course there's still some stuff lacking mainly we don't have any corners and the inside of our shape is comes dmt to fix this let's select our ground profile and let's start by adding a fill of course we've created a tile for this as well this is tile sex however we can see right away that looks pretty weird the reason for that is that we need to make sure to select the tile that we want to use as fill and set the wrap mode to repeat if we apply that it already looks better however it's currently tiling way too closely let's go in here and set the pixels per unit to 16 here as well and now we can see that we have a nice fill on our tile the last thing that we need to do is add in corners and these are simply defined as separate sprites so for the outer top left corner I'm going to select tile one here for the hourly top right corner I'm gonna select aisle 3 for the bottom left corner I'm gonna select our 9 and 4 bottom right I'm gonna select aisle 11 now these are currently not showing up in our sprite shape and this is one of those things that confused me at first but that's because we have the opportunity to go in and define what points we want to act as corners so if we edit the spine here we can select one of the points and now we get to choose what to do with the corner we neither choose disabled or automatic I can see as soon as we choose automatic the cornea snaps right into place let's do this for all of the points and voila we now have a really nice-looking ground element so let's stop editing the spline here let's move up our objects so we can see everything clearly and there you go that's my introduction to sprite shapes from here it's up to you to create your own custom sprites to play around with and just have fun shaping your own Devils it's a really creative and fun tool to use I do also think that there is a lot of stuff that could be improved here I think the UI is a bit cluttered I think some of the ways that you set up your profiles is a bit overly complicated and generally could just use a tiny bit of tidying up but it is still in preview so we have to cut the developers some slack and it is already a really great tool in fact there's still stuff that you can do with this that I haven't shown you for example you can easily add variations if you don't want to just be tiling the same tile over and over and that's actually also an API you can use to script your own custom behavior if you want to learn more about those things I'll of course have a link in the description awesome so that's pretty much it for this video if you enjoyed it make sure to subscribe and bring that notification so you don't miss the next one also make sure to check out Skillshare simply click the link in the description to get started and if you haven't already joined our discord definitely make sure to do so there's a lot of really exciting stuff happening there at the moment the community is hosting a bunch of events and it's just a really fun place to hang out on that thanks for watching and we'll see you in the next video thanks of the awesome patreon supporters who donated in September and especially thanks to enter to the Minko art arming true VR systems simmer IO excited player cheetah 3d Jeff Johnson infinity PPR Sybok mommy Danny Sullivan Chris Sheriff Abdullah prism fi thanks alone clear the set Vincent Vince Cuba shreya ste Dirk Eames Kirk Ronan Chima Poltava Bruins cat now Akiva sake Gregory Pierce Larry tweet James Rogers Rob Perrin become Vania Erasmus Robert bond car Jackson James P Anthony Patton Q Swedish key and a brief see you guys Rock
Info
Channel: Brackeys
Views: 258,301
Rating: 4.9669576 out of 5
Keywords: brackeys, unity, unity3d, asset, assets, beginner, easy, how, to, howto, learn, course, series, tutorial, tutorials, fix, tip, game, development, develop, games, basic, basics, spriteshape, sprite, shape, 2d, organic, level, levels, design, tile, tiles, platform, curve, spline, editor, path, paths
Id: GSo_fU1JdfM
Channel Id: undefined
Length: 11min 57sec (717 seconds)
Published: Sun Oct 14 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.