Animation Rigging Part 1 - Attaching the Weapon || Unity3D

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey hey what's going on folks it's your boy Mike from bigshot studios in this video we will be going over animation rigging I forgot to delete it out of here but the thing you can do is you can go into package manager and make sure that under advanced you do show preview packages and then you'll find the animation rigging and install and it'll pop up in here next thing we'll do I added a new model it's m4a1 I will be providing this prefab inside inside the description so let's get started alright so now now that you have everything installed into unity what you need if you don't have it yet make sure to to hit the pause button because we're gonna be getting into a lot of new things so first things first we'll click on the player I just make sure everything is in here that you need you're gonna right click on the player and hit empty game object and we'll rename this to rig layers hand oops Heike and under the the rig layers hand i k we're gonna add a component and we're gonna add a rig and then we're gonna go back to player we're gonna had a new component and it's going to be a rig builder then we'll drag and drop the regular hand i k into that that's lock under the rig layers what we'll do is we'll right-click and do an empty game object and we'll rename it to right and okay and then we will add a component it's gonna be a to bone like a constraint and then we will go into the rig of the player and under the right shoulder what you're gonna do it's asking for three different ones the root the mid and the tip the tip is always gonna be the hand for hand by K and then your forearm for mid and your right arm for root now under source objects it's asking for basically your your I K what we're going to do is this is when we're gonna add our our weapon into the game we will put it straight under the player that way you know it's where it needs to be we'll move it over into place right around the right shoulder even if it's kind of hitting inside that's okay for right now it's not something that we're gonna have to deal with right off the bat the first thing we can do though is when you've imported this in for make sure you you hit add component and we'll go back to rig transform and now with this rig transform you can move around the weapon and it'll move the hands with it once we set everything up under the weapon itself we are going to right click excuse me right click and create empty we're going to rename it to right hand target and then under the right-hand ik4 the target will put it under target for the hint we will go to the right forearm and we'll right-click and create an empty rename it to right and it's under the hint we will add this right-hand hint now the next thing we can do is we can go to right hand hand just click on right hand hand click this little plus sign that you see under animation rigging and you'll you'll see this box pop-up now if you go to this little circle right here where look locator effector is and then you type in the search bar the ball and use the ball effector what you can do is you can move it back and it's kind of like this thing where you can you can click straight on it without having to go through your hierarchy it helps out with the rigging it shows where everything is there's a ball effecting there's also a cube effector or a box effector but another thing you can do is you can change the color of it so like let's say I wanted to I don't know green then now you can see I have a green ball instead of a red you can change the size to be big to be small I'm going to leave it at point one you can change the position here but I recommend not doing that until we've done everything and now that we have our right hand pretty much set up under settings everything stays the same so you see your weights here you have weights here and then you have your rig builder here this rig builder will come in handy later on when we get into later episodes for right now we're just gonna be working on putting the weapon our putting the hands on the weapon so the first thing we're gonna do is we're gonna hit play we're gonna wait for it to open up alright now as you can tell if you go into the scene view you'll see that the player's hand is actually on the weapon now and that's what this reference right hand target is for if you go to this right hand reference target then you can move around the the players hand and do whatever you need to do so what I'm going to do is I'm going to go ahead and I'm going to twist it I'm gonna make it to where it's supposed to grab the weapon kind of pull it back and I'm gonna pull it over we'll come whoops would go I'm gonna pull it down alright just a little bit it looks like I start right starting to work alright and then the next thing you're gonna do is you're gonna grab that in four and you're gonna pull it over just a little bit now you see you see his his elbow and the way it is if you go to the right hand target you want to come up to these three dots and you copy component come out of play mode and paste those values the reason why you're doing this is so that way it goes back to those values inside when you hit play again so now that we have those values set your hand should be right where you said it before now the next thing you want to do is you want to click on this little ball or if you don't have that ball make sure you click right in int and you're gonna move his elbow now it shows his elbow moved out it's not all craze he doesn't look weird anymore it's not sucked into his body and then you want to do the same thing hit them three dots copy component I come out of play mode and paste those values and when you hit play now his his elbow should be the way you positioned it before and as you can tell it's doing that right now so that's perfect the next thing we're going to do because this weapon is is a little too far over still we're gonna grab the m4 and since you put on a rig transform you can move this rig and it moves the the arm as well so we're gonna move it here and we're going to come over just a little bit and we're gonna move the weapon back kind of put it in the shoulder just a little bit move it over just a little bit more and I think that looks good right there we will see more of that here soon shortly so now you got the m4a1 selected make sure you copy that component and you paste those values that way the the weapon goes where you want it to be the next thing we're going to do is we're gonna go under this rig layers hand I K we're gonna duplicate the right hand okay we're gonna rename it to the left hand I K if I can spell left hand I K and then under the left hand I K we're gonna do the exact same thing except for the left so the left hand goes on to the tip the forearm goes under the mid and the left arm goes under the root for the source object we're going to come down here into the weapon we are going to duplicate the right hand target we're going to rename it to the left hand target and we can just leave it where it's at for right now we will change it all in the scene view and then we will go back to left hand i K put left hand target in the target and then under the right forearm or right click create' f2 left hand hint go back to the left hand I K and drop the left hand a hint inside the end now once we've done that the next thing we do is we just hit play once that pops up go back into the C mode and now you see that the left hand is starting to deform so if you go to your reference left hand target you can start moving your your left hand where you need it to be rotate it I want to rotate it back this way kind of do this this this now I'm gonna move it down bring it back this way it's just a bunch of bunch of moving around until you get it right where you want it to be I'm getting close and it looks like that's going to be a good position for that that left hand I K thumb is kind of through it there's not much you can do about that I guess I can turn it just a little bit there we go looks a little better bring it down this way and up oops trying to get that foam out of that yeah it's just a lot of a lot of trial and error I guess I can deal with the thumb being inside the weapon itself you're really not going to see all this anyway it's just to get the the weapon looking pretty decent now if you're still selected on the reference left-hand target make sure you do the same thing and you're going to copy that component come out of play mode and you're gonna hit paste component values hit play and this should put the weapon right where it needs to be now if you run you'll notice that the weapon is not bouncing around with the player and there's actually a very quick fix for this the only thing we need to do is we need to grab this m4 and under the right hand shoulder we will drop in our drag and drop there and now hit play and you'll notice things get a little little wonky and that that's easy to fix only thing we have to do is we go into scene mode and since we put that rig transform on the on the weapon itself now we can move the weapon around and it'll move around the hands as well so that what we're going to do is we're gonna put it in a pose like we are not not aiming make it a little whoops and it kind of looks like we are you know running with the weapon instead of aiming put it there and then we will kind of lift it up just a little bit like this make sure it looks pretty decent back here right then we will copy that component come out of play mode and we will paste it so now when you hit play the weapon will automatically be it or its hands will be automatically attached to that to the weapon and then when you run the weapon acts like it is attached so it bounces around everywhere so no matter no matter what position you're in it does what it needs to do now at any time if you wanted to take the hand away let's just say you wanted to take the left hand away we'll go down here on the left hand like this go to the left hand left hand I K and if you hit the wait it'll drop the drop the hand say you could do that with any of them for instance like the right hand you don't want the right hand up there the right hand will drop and you can you could actually make different animations and stuff like that with this I'll show you how to do that later on in the series but for now you know I think we're at a good spot you could do a little bit more tweaking do a little bit more playing around you could do this with any with any bone on here pretty much but this is this is pretty much where we're at for right now this is animation rigging as you can tell I did no coding at all everything was game objects and animation animation rigging layer that unity provides and this came out in a couple years ago and actually it works great in the in the editor I use which is two thousand nineteen point 3.0 f6 from what I understand and I'm not a hundred percent sure on this but from what I understand it's not working on earlier versions it's anything 2019 point three and up and actually 2020 has a lot not a better lot a lot more features on it I'm waiting until it it's fully released because this is still in preview but it does work but anyway guys thanks for watching make sure you hit the subscribe button I hit that notification bill share this video make sure if you need anything or you want to talk about anything or you want to suggest new videos or request new videos or anything like that make sure everything goes down in the comments I will be putting that weapon inside the the description I'll make sure to put it on the web that way you can get to it you could pretty much do any weapon you want to it's just a weapon that I picked from from a package that I have which actually I'm using in another project but it's a game that I'm making and I'm everything you see here I'm doing in this game so you know this this is legitimate this isn't something I'm just throwing out there for people to play around with this is something that I'm that I'm practicing myself so you guys have a nice night and I'm the ho
Info
Channel: Final Stand Studios
Views: 13,348
Rating: undefined out of 5
Keywords: unity3d, animation rigging, rigging, IK, inverse kinematics, third person shooter, tps, survival tutorial, unity tutorials, unity tips, blend trees, Player controller
Id: iirDUDTkYAU
Channel Id: undefined
Length: 19min 18sec (1158 seconds)
Published: Mon Jun 22 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.