Use Attach Tracks to pick up and throw a banana in Sequencer. #UE5 #UnrealEngine #Animation

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video you're gonna learn how to use an attach track to point constrain a banana to lola's hand and then how to let it go and knock over a camera so get ready let's go so i brought in our character here from miximo lola with the throwing something cycle let me show you that so if you go over to mixmo.com grab your character grab your animation you want and then bring it back over here into unreal if you're unfamiliar with that process then why don't you hop over to another one of my videos this one here that has the placement running from mixmo and then into a scene send mixed mode characters and animations to unreal engine if you don't know how to do this i highly recommend you uh go watch that it's really useful for stuff like this so back over here again brought in lola into my sequencer hit play to see what her cycle is and i've kind of already posed some bananas there in place for her to be able to grab one and throw it so i have a particular hero banana right there whoops not right there right there which she's gonna grab so let's come in a little closer here oh i'm looking through the camera just a minute so let's come in to our hero banana and there it is right there so the idea is of course she comes down and let's work through the cycle here she comes down grabs the banana and right here we want it to uh stick to her hand right so we're gonna go through a few different things you need to be aware of for this whole process but it's actually easy once you know how to do it like anything in life right so what we need to do for the banana is add it to our sequencer so let's go back grab our hero banana and we're going to add the hero banana to the sequencer and right now it has a particular transform on it and what we wanted to do is use what's called an attached track in maya you have a point constraint so it's kind of the same idea you're animating a constraint system so what we want to have happen is right about let's say she comes down puts her hand right about there when it right before it starts to come up right so again i'm not worried about the particulars of this i'm not an animator i'm just showing you how this tool works but i do want to make it decent at least so the hand comes down let's go frame by frame and let's say right when it starts to come up we would expect the banana to be in place here and maybe here but after this frame it should start going up with the hand right so i'm going to say from here forward i want it to stick to the hand now there's a few things we'll talk about in this process so there's a few layers here so let's start first with the basic concept of an attached track so it's the banana that you want to attach to something else so what you're going to do is click on the add a track button for the banana you're going to go to attach and i've changed this value here to preserve current the reason i've done this is i want the banana to stay where it is when i attach it for this frame to the character i'm going to come back and make some changes but if you don't it's going to kind of jump off funky and weird and then you'd have to zero out the transforms which which you can do if you want the object when it touches whatever you're constraining it to or attaching it to to stay in its same position you want to flip your switch here to preserve current so pretend i just did that from yours that says none right so then i'm going to come back here again i didn't do anything yet all i did was go to attach and change this setting but now when it's set to preserve current you're going to tell it you want to stick to something so i want it to stick to in this case lola and you might have lola sitting right here because she's already in the sequencer but if you don't see something in there you can go find it here but here's lola and i want it to stick to lola then it's going to say what bone do you want it to stick to now we're going to have to fix something but i'm just showing you the basics first so this is close to her right hand right so i'm going to come down here and i'm going to click on her right hand and that is now going to stick with this exact position this exact offset in world space it's going to stick now to the hand so let me advance a few frames forward and now you see the banana is stuck to her hand and let's zoom out just a little bit and it's it's it's okay but it's technically not sticking in the right place and if i come in here a little bit more and oftentimes what you're going to want to do is have the object stick exactly to an exact point and what that would mean is now you'll oh also see how it put a keyframe here it put a keyframe on the transform track because when you told it to attach with the preserving that offset then it it calculated where that position is for you and set it relative to your attach point so your attach point remember i said it was the right hand so i'm going to come up a little bit the right hand joint is somewhere about here and we've set up a parent relationship here when we added that attached track it put the hero banana underneath lola lola became the parent of the banana and at that position that we chose which was the right hand let me go ahead and come now here to this xyz value and zero it out and the banana is going to pop to where it is parented to which in theory is what you want you want your in this case you want your object to stick exactly where you want it to because if you start rotating and moving your object around you you want it you want to have a little more control over where the banana is sticking to the catches we don't want it to stick to the wrist right and we don't have any joints we might have a finger joint that's kind of close but even then it's not the exact same position so what we need to do is we need to go over what's called adding a socket and it's kind of like adding a floating joint but it's not a joint it's just a place where you can attach something like this because we want maybe in the center of the palm of her hand an attachment point which is what is called a socket and you do that in the skeleton so let's pause for a moment first make sure you understand what i've done so far i took the banana and i attached it to the wrist because that was the closest thing i had let's make something even better so backing up a little bit let's go to the content browser go to wherever you have lola and open up the skeleton so i'm going to double click open up the skeleton and here we have where's the right hand here is our right hand and i'm going to go to character bones all hierarchy so i can see the whole skeleton and so if i want the banana kind of in the palm of her hand not really at the knuckles and not here at the wrist i want it to stuck somewhere more in the middle i need to add that's a piece of cake all you gotta do is select the bone that's kind of the closest parent bone that you would want right click and choose add a socket when you do that it's going to create this item so here's the right hand and then underneath it hierarchically you'll see it says right hand socket so what that does right now it's in the exact same position but i can select it use the move tool and i can move that to a slightly different position so i can move this to the center and let's visualize the socket so if you go to character bones and turn on socket it's just really a locator where's that little guy come here you so you see this little diamond in there kind of this little diamond well let me move it out of the way that and you can see the the line here connecting it to the wrist because that's the parent this it's basically like you're making another bone but it's not a bone it's just an attachment point but it's kind of like a bone so i'm going to put it for the moment right here in the middle of the hand now i don't want to just deal with trial and error and set it go back and check and the scene then come back here and adjust it a little bit what i want to do is let's bring the banana in here so i can see where the banana is going to line up so on the socket itself i'm going to right click and choose add a preview asset and i'm going to go up here and i'm going to type banana and i'm going to grab my static mesh from the content browser all right so here is the banana and what you can also do is you can orient your socket to hold it the way that you want it to hold the banana as well so let me jump back for a second how do i have she's picking it up with it the curl of the banana just the way i already have the banana setting there is kind of going into her fingers as well right so i'm going to come back over here and i'm going to choose the socket and this is just for preview you don't get to keep the banana here it's just for us to see so i'm going to come in here and i'm going to rotate the socket right so when our fingers are curled and the palm is there it's maybe you know and that i have an even better way for us to preview this in a second it's still a little like two embedded in her palm right so let's say maybe it's here but it's kind of hard to tell because her her pose has her hands straight out and in our scene she has curved fingers and such so what you can do you can preview the specific animation for this character and then keep refining your socket position so if you go over here you know sometimes you might have to click around to see which tab is the one you need in this case it's this one here asset browser double click on the actual animation cycle and that's gonna put it into action right so what's happening is her hand is doing what it's doing what i want to do is stop somewhere and zoom in here and see how this is lining up in her hand i could if i want i can actually come closer to where she picks it up because that's about what we want to know what it is like right so come over here and let's see what do i think is a natural place for her hand to be now i'm also going to turn the bones back off because now they're kind of getting in the way so select it only so now the banana if i want to alter how it's going to attach to the hand i need to go grab the socket again and adjust the socket's orientation so that and you can switch if you need to between world space and local space whichever helps you better so i'm gonna adjust a little bit there maybe rotate a little bit there because when she picks it up i think it's more like that so what we're adjusting is basically the socket's orientation right now in position if we wanted to i could also come back to the move tool and offset where it is a little bit right so if i want to hold it about there now the hand pose may not be perfect for holding a banana like does the thumb go under it or over that and that's something you can fix an animation all this is fixable things depending on how much detail you want to deal with i'm just showing you how to add a socket and how to um preview attaching something to it so let's say this is good enough let's go through a few frames so picks it up it's still moving let's see it closer to the throw so let's come in here closer throw she's still holding it you can animate this offset as well if you need to it's actually the bananas transform is what you can offset relative to the socket you wouldn't animate the socket you would just animate the transform relative to the socket of the banana but anyway let's just assume she's not sliding it around in her hand the whole time she's just grasping it and holding on to the banana getting ready to throw it so i think it's looking pretty good like it's aligning fine you'll notice it rotates with the uh the joint or the socket as well so it keeps its orientation in the hand so that's nice so we'll say this is fine all right save once we save that we are going to go back and reset the socket to to be the thing that is used and not the wrist itself so let's see i can ditch the skeleton i can ditch this animation cycle let's go all the way back to our sequencer so right now this is constrained to the right hand which is not what we want we want it to stick instead so let's kind of start the process over because you may have put the socket in before you did this i did it the way we did it to show you what happens if you don't have a socket and why you need a socket so let's i'm going to ditch that key i'm going to ditch this animation and stitch this key oh and i have one at the end so i'm just kind of backing up to where i started okay so getting rid of all the keys so pretend you're back at the beginning you already added your socket and everything was in the right position here so you come through here click click click click and this is the frame maybe this is the frame where i want it to start sticking and then moving after that right because the fingers are going to push it away so this is the frame where i want the attach to begin i do the same thing again i can delete this is there's nothing here so i just delete that and then going back to the beginning attach don't forget to make sure you say preserve current if you want the banana to stay on this frame right there otherwise it's going to potentially pop somewhere and stick it to lola this time you'll see there is a right hand socket that's the one we made we could have renamed it if we wanted and called it like banana attachment point but i'm just gonna leave it called right hand socket all right it put a key here because now that is a keyed position we don't have any keys before it so that's fine but at this point it keys the value of the banana and so this is a relative offset from the the actual socket point so this slight offset so what i would do in this case is i don't want it to have an offset through the whole thing so i might pop in a few frames just pop in a few frames because see now it's kind of already maybe a little off because of the this offset so i'm going to hit the and that was a quick slight of hand during a full animation that nobody would notice so i'm going to hit this reset button all right now it actually is popped up into the socket there's no so this value here this zero zero zero that is the parent child offset and there is none so it is its pivot point is now snapped to the socket which is where we put the sockets all is good okay so i think the front half of this animation is going to be good the socket is working so i'm going to pick up the banana click click click all right she's picking up the banana you see it's pivoting with her hand as she pivots as well right so that the rotation of the banana follows the rotation of the socket all the way through going off to throw it oops my little thing's hanging up there um i don't know why it drifts separate but don't worry about it because the banana is in the hand and that's what we care about just the manipulators doing a wacky thing so but let's talk about what we do at the other end at the other end we want her to let go of the banana eventually we don't want her to keep holding onto the net you know he's spiking the banana into the ground so there has to be a point where we release the banana so i think this frame might be a perfect release point so let's say on this frame i want to know this banana's position because i'm going to let go of it from the attach and i need to know where it is so that i can set it there in world space so what you're going to do is you're going to come here to this location field because you're going to say wait is 0 0 0 what is its actual position in space switch this to world for a second right click and copy that then switch it back to relative okay so now it's still banana is still working but we have on the clipboard that particular value and if you click away and click back the manipulator pops back there again i don't know why it does that but it's just a little funky so now all we need to do is let's drag the attach track to the point where we want it to let go alright so now the banana has been let go if you go back one frame it's there in the hand if you go the next frame it disappeared it didn't disappear where'd it go it went to zero zero zero because that is the transform value that we have set on the banana way back at this point so it is still staying at zero zero zero when it was parented to the hand socket it was in the middle of the palm but now it is at world 0 0 0 because it does it's not parented anymore which is why we copied the value before we let go of it so we know what it is but before you do it or you can do this after i'm going to go back a frame because remember we're looking at the transform of the banana here i'm going to go back one frame and i'm going to set a key here so that it's at 0 0 0 and then on the next frame it's going to let go of the hand and go not to world zero zero zero i'm going to right click and paste and then now the banana comes back to where it was but it's technically no longer attached to the hand so now if i continue through the banana is going to stay in space oops sorry sorry sorry sorry come here hero banana so let's zoom in a little bit here see what's going on i'm going to back up a few frames so remember this frame it's attached this frame it is not attached because we ran out of attach we we told it to stop and that's why when we keep going with the animation the banana just hangs in space from here it's up to you to just animate your banana doing whatever you want your banana to do when she lets go it can throw it can spin it can tumble around right you all know how to do a plain animation so let's for example do i've auto key on yes so so let's just say she threw it straight it goes off that way so come back here and click click click she let go oh it's going really slow so uh yeah you'd want it to go a little faster than that but that is for you to do in determining what kind of animation you want on your banana once she lets go of it okay so in summary there's a lot of processes and a few different steps but once you understand the overall concept it's not going to be that big of a deal for you the attached track is how you attach an object to in this case a character's bones and if there's no perfect bone for it then you can go into the character skeleton right go into the character skeleton like we did go into where you want to place a bone pick the closest parent which in our case was the right hand and we added a socket we right clicked and chose add a socket this made the socket and then to put in the preview banana we right clicked on that added a preview asset and then went browsing for the banana and then you would have the banana in the hand like we do here okay the banana is again just for preview so you can see it and while you were here to qc again you would double click here and you can see how the attach is working okay i think that'll do it for this one the again it's all about the attach track right here just don't forget if you need it to change this to preserve current otherwise you're going to be chasing your banana all over the place that was a lot why don't you take a break and watch this stop-motion animation by my son dexter it's actually pretty good if you've subscribed to his channel i'll make a lot more videos all right if you have any questions or better suggestions of how to do this like like anything in a real there's five other ways to do this this is just a way that seems pretty uh quick and easy to do so that's what i wanted to show you all right cheers y'all
Info
Channel: 3D Education with JC
Views: 11,983
Rating: undefined out of 5
Keywords:
Id: 3Zj-h2xCCPk
Channel Id: undefined
Length: 21min 3sec (1263 seconds)
Published: Wed Jun 08 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.