Godot Quick Tip - How to use AnimationTrees

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
right so I have a 3d character here I've rigged and I want to animate it so just editable children there I'm going to add in a animation tree on here and then just going to go select tree root here I want to make a blend tree and then just middle mouse button click to navigate in there and then I want to assign an animation player so I'm going to choose the one from my character model there and then let's just click active it's not going to show anything yeah I'm gonna click Add node here animation and then I'll just click this and I'm gonna head you can see all the animations that are on this animation player here I'm going to add run forwards here and I'll just drag this white dot to there and you'll see it gives an output the character is now walking forwards with the lower body and then but I want to be able to connect upper body and lower body so let's see add in animation add in to animation nodes here and then I'm going to get a blend node here and I'll just drag the output to that this onto this and this one to this and then I'll choose you run forwards there and then the let's say aim one there and then I want to blend this one to max then I'm gonna edit the filters on this and select enable filtering and then check all me the bones I want it to affect so only the leg bones and lower body stuff on this so now that it's on max this lower body animation will only affect the lower body now it's on max and it's filtered only to the lower body so now I can affect both the upper body and lower body separately but I want to be able to trigger something I wanna be able to trigger like a reload animation so I'm gonna add another animation here and out there and this will be let's say reload pistol here and I'll add in a one-shot animation connect these up and now if I hit on it'll play the animation and then it goes back to this one so plays the reload and then when it's done it immediately goes back to this that's pretty good now I have a run backwards animation and I'd like to be able to choose between playing run forwards and run backwards so I'm going to add in a blend space one dimensional here and just close that open editor here and I'm going to I'm going to select a create points here add animation just left click there and I'm going to choose run backwards then over here and animation choose run forwards and I can come back to the root attach the output to be blend there and for that one and now you can see it's at zero so it's kind of blending halfway between walking forward and backwards so I'll set that to one you'll see it's playing walking forwards I can set this to negative ones and it's playing walking backwards now I could have just used a blend 2d for that also but this a little more recommended way to do it keeps your blend tree a little cleaner now if I had a walking left and right animation - I could have used a blend space 2d which gives you x and y so I could have like inserted the walk forwards up here the walk backwards down here walk left over here and walk right over here and then just place edit the x and y based on which ones I want to use for that but I don't have that so I'm not going to bother with that now how do I actually modify all these from code a way to do that som that is script to the animation tree here and all I really have to do is call set and then on this animation tree if I select it you can see there's something here parameters and you'll see it shows all the nodes names so this one's name blend to the 2d one - this one's called one shot this is spline space 1d and I can change the name it's there to whatever I want kind of thing you'll see a change up there it automatically capitalizes them and if you use underscores it will remove them so just be aware of that but I can just take the name of this and I'm just going to go parameters and then slash whatever the name of the note is make sure you know it's converted properly to be for there and then I can take the value like see this one says active and it's a boolean so I'm just gonna put active and then I do true and so now if I were to run this it would be the same as clicking the on there right and then if I want to run maybe I want to change the blend space amount here so I just go over here blend position so I write that lowercase with an underscore instead of a space and I can just set that to negative one right and that'll be the same as changing it in here to a negative one or one or whatever so that's how you change it in code and that's really all there is to it
Info
Channel: Miziziziz
Views: 82,450
Rating: undefined out of 5
Keywords: godot, godot 3d, godot animation, godot 3.1, godot animationtree, godot animation tree, godot 3d animation, godot character animation, godot 3d character animation, godot tutorial, godot 3d tutorial, tutorial, animation layers, godot animation layers, godot animation layer
Id: WY2cN9uG6W8
Channel Id: undefined
Length: 5min 37sec (337 seconds)
Published: Tue Apr 23 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.