Animating a 2D Character in Unity (Rigging Basics Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys my name is Thomas brush in the creator of a game called pinstripe and a game called once upon a coma both games are launched or launching comas about to launch on pretty much every platform you can imagine switch ps4 Xbox steam whatever it is you want to play it on it's probably there so click the link in the description to check it out if you guys want a free copy of pinstripe you could support on patreon that would really mean a lot to me all right so the thing is is that we designed a character in a previous video in Photoshop specifically we designed a 2d version of link from breath of the wild that was really fun and now I want to show you how we're gonna rig it in unity some of you are thinking oh boy we're gonna be rigging a character we're gonna create a skeleton and rig it up and create the mesh and have to paint all the weights it's gonna be really really difficult it's actually not unity has an incredible new rigging tool that is so easy to use that was it really surprised by it no more external plugins just jump right into unity bring it up and animate your character so let's jump into unity get started but first before we get started guys I want to thank this video sponsor Skillshare thank you so much Skillshare for sponsoring this video skill she has an incredible website for you guys to learn about pretty much anything you want to learn about specifically if you want to learn about game design it's an incredible place whether it's audio design for your games or 2d illustration or animation or unreal coding storytelling marketing business management whatever it is you need to learn about game development it's on Skillshare the coolest part about this ad read is hey get two free months of Skillshare by clicking the link in the description you really can't beat that guy's give it a shot see what happens I love Skillshare it's a great way to learn about game development alright let's go ahead and get started alright guys the first thing you're gonna want to do when you create a new unity scene or unity project is you're gonna jump into your package manager and you're going to click this advanced button and click show preview packages and you're going to want to import the 2d animation tool and then also you're going to want to import the 2d PSD importer tool as well once those are installed you're good to go fortunately I've already installed those for this tutorial and right off the bat you're gonna see that in my art folder here I have a little prefab called link and if I double click on that you'll see that it's a PSB file it's not a PSD file it's a PSD file and that's just basically a variation of a Photoshop file that imports extra data into unity so that we could figure out what we want to skin and how we want to skin it what's really cool is all of my layers here which are named intuitively including his hands his arms his bicep his head and so forth what's really cool is when this is imported into unity it's going to auto generate a prefab out of that PSD and I can actually drag that prefab and you'll notice that all of my layers are Auto arranged now this is amazing this is certainly something I didn't have five six years ago when I was making pinstripe for those of you who are starting unity now you're spoiled rotten you have an amazing tool so what I'm gonna do is actually show you how to take this PSB and actually rig it up so that we can move his arms and animate his head and his sword and do all sorts of cool things with our link model here so let's jump right into our importer settings when we select link here you'll see that the mesh type is set to full rect instead of tight it's gonna default a tight so you're going to want it to be full rect and then go to your sprite editor and you'll see that everything is sort of separated out into various sprites we're not gonna do anything here where we're gonna go is we're gonna click up in this top left hand corner click the drop down and go to skinning editor and this is going to allow us to create bones so the first thing we're to do is we're gonna create a bone so let's click this create bone button and what we're gonna do is we're going to start at the pelvis and we're gonna create two little pieces of a spine we're gonna right click so that we can actually start a new position to about right here but be sure you're selecting what it's actually attached to so it's okay to move your bones away from where they're attached so about right here in here and then this sword right click again and then what we're gonna do is be sure the second portion of the spine is selected and then select here to here and then we're also going to do a head and we're also gonna do his legs so I select the bottom portion here because that's what the legs are connected to and we're gonna move away from it to about here go down to his knees and we don't really need a feet or a foot bone so where I could worry about that we do the same on this side as well so if we click on this preview pose button and try and pose our character you'll notice he doesn't actually move and that's because we haven't actually attached any of the mesh the actual image to the bones fortunately it's really easy to do in unity all you got to do is click Auto geometry and what I like to do is down in this bottom right hand corner I like my subdivisions for my mesh to be pretty high so that I have the ability to paint highly detailed areas if I put it down to about 14 it would create a very low poly mesh and it might be a little bit difficult to paint onto that mesh so let's put it at a hundred so that I can show you exactly what I mean we're gonna click Auto generate for all visible and right away you'll see that our mesh is created this is really amazing for those of you who are familiar with blender it feels a lot like working with 3d modeling but it's creating a 2d mesh for us so let's go ahead and try and see if the auto generation actually worked for us Wow really did this is amazing there are some things that are a little weird like this strange sis - coming out of his chest but overall this is pretty good okay we'll need to fix that we'll need to fix that he's got a nice thin waist there and you'll see a sword isn't bending properly so the fortunate thing about unities sprite editor tool and rigging system is we can keep our rig like this and then start painting and watch it fix itself as we paint so let's go to our weight brush down here click the weight brush and what you'll notice is if we zoom in there's certain portions of our character that need to be fixed so what you'll notice is that this spine here we could probably paint full red right here and right here now you notice that nothing's actually getting painted even if I select this bone and try and paint with this bone nothing's actually happening and that's because we actually haven't selected the mesh to paint so first things first double click and now you'll notice that the mesh is selected and we can choose to paint only on this actual mesh and again this mesh is actually this image here this layer body so we could choose whatever we want to paint using the selection tool or by double clicking now you'll notice that this mesh is really high poly so let's go ahead and backtrack this was just to show you how you could subdivide each mesh we really don't need it to be that high so let's jump back in time and do a lower poly count so again hit auto geometry and let's just put it down to about 30 and click generate for all visible so this looks a lot better and this looks much more reasonable in terms of painting we didn't need that many but if you ever have trouble painting you can definitely mess with the subdivide to get a little bit more detail when you're doing your weight painting so anyway let's go back to our weight brush let's zoom in here and let's just move our bones around to get an idea of how things look so that we can actually fix things that are problematic so again we're gonna double-click on the mesh we want to paint and then we select the bone that we want to paint so in this case it's almost like selecting a swatch so let's select this red bone here and simply paint and you'll see it fixing itself which is just amazing dude nice belly all right pretty cool let's take this purple here and just add in a little bit of fixing here there we go and let's double-click on the sword and then the blue bone and we're going to paint the sword and the hand so that they sort of move in conjunction with one another that's perfect I love it okay anything else here that needs to be fixed so far it looks pretty good that one this arm really shouldn't be affecting this portion here so let's double click here and then take this yellow and actually paint away any of that pink yeah there we go we didn't need that there we go something like that we could probably paint a little bit more here there we go perfect now it's okay if you want to paint a little bit so that it sort of blends together something like that so you can see now his arm is sort of pulling at the sleeve at the shirt here we go awesome all right so it's not perfect but for our demonstration here that looks about right so let's hit apply and exit out and now all we've got to do guys let's delete this let's just drag in link into our scene and we're gonna scale him down to about 0.2% and let's Center him up now we can see link in game here wasn't that the most easiest thing can I say that most easiest let's just say it wasn't that the most easiest way to rig a character I am really impressed with what unity has to offer here this isn't even sponsored by unity I just really really like what they did here so go ahead and open up unity and give it a shot and see what happens if you guys liked this video click the link in the description I mean wait you can click the link in the description but leave a comment subscribe and hit the notification bell and don't forget you can support our patreon get a free copy of pin stripe thanks guys bye oh wait guys I wanted to tell you about someone there's this dude named Johnny been made I think that's how you say his name and I want to tell Johnny that you can do it dude keep working hard keep working hard it's worth it and I am proud of your work ethic I heard a lot about you he's a great fan of this channel guys and I wanted to give him some encouragement and a shout-out you got it go go go get it done you
Info
Channel: Thomas Brush
Views: 59,130
Rating: undefined out of 5
Keywords: thomas, brush, unity, unity3d, texture, textures, material, materials, beginner, easy, how, to, howto, learn, course, series, tutorial, tutorials, tip, game, development, develop, games, programming, basic, basics, 2D, 2D animation, animation, skeletal, skeletal animation, IK, IK manager, rig, animate, rigging, weight, painting, bone, bones, anima, animator, key framing
Id: 3Sa-5hi362M
Channel Id: undefined
Length: 12min 16sec (736 seconds)
Published: Sun Oct 06 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.