Це відео не доступне.
Перепрошуємо.

How to Use the AnimationTree Node in Godot | Godot Animation Series

Поділитися
Вставка
  • Опубліковано 7 чер 2020
  • In this Godot Tutorial, I will teach you how to use the AnimationTree node in Godot. The AnimationTree node is a powerful node, helping you to substitute many lines of code in your scripts!
    In this AnimationTree node tutorial, I will show you how to set up the AnimationTree node, how to add BlendSpace2D nodes to the animation tree, how to set up transitions from one animation mode to the other, and finally, how to activate each and every single animation through the code.
    ⬧⬧⬧⬧⬧ GDC TUTORIALS ⬧⬧⬧⬧⬧
    I believe educational material should be available to all, for free
    Support this vision by joining the GDC-Club and get perks in return
    / gamedevelopmentcenter
    / gamedevelopmentcenter
    ⬧⬧⬧⬧⬧ LEARN MORE GAMEDEV ⬧⬧⬧⬧⬧
    These books have helped me in my game design and programming, I whole fully recommend them to you!
    Level Up! The Guide to Great Video Game Design ►► amzn.to/3hIg6dE
    Game Programming Patterns ►► amzn.to/35IoDsH
    The Art of Game Design: A Book of Lenses ►► amzn.to/35MSHoU
    ⬧⬧⬧⬧⬧ LIVESTREAMS ⬧⬧⬧⬧⬧
    I Livestream game development twice a week right here on UA-cam.
    Subscribe and hit that Bell Icon to make sure you don't miss it!
    www.youtube.co...
    Tuesday and Thursday
    1900 to 2200 (GMT+1/2 (winter/summertime), that's;
    1200 to 1500 (PST), or
    1500 to 1800 (EST).
    ⬧⬧⬧⬧⬧ COMMUNITY & SOCIAL ⬧⬧⬧⬧⬧
    Join the community! Follow me on Social!
    DISCORD ►► / discord
    TWITTER ►► / gamedevstefan
    ⬧⬧⬧⬧⬧ ABOUT GDC ⬧⬧⬧⬧⬧
    GDC, Game Development Center, was created to provide in-depth tutorials on game design theory and game development using the Godot Game Engine. I aim for multi-part Godot tutorials, allowing me to dive deeper into Godot's features.
    ⬧⬧⬧⬧⬧ ASSETS USED ⬧⬧⬧⬧⬧
    opengameart.or...
    ⬧⬧⬧⬧⬧ DISCLAIMER ⬧⬧⬧⬧⬧
    Some of these links go to one of my websites and some are affiliate links where I'll earn a small commission if you make a purchase at no additional cost or disadvantage to you. You will receive the same price and service.

КОМЕНТАРІ • 99

  • @GameDevelopmentCenter
    @GameDevelopmentCenter  3 роки тому +30

    Do you believe that Godot education should be free? Me too!
    You will never find me on Udemy, Mavenseed, or Gumroad.
    Support these tutorials in any way you believe is appropriate; like, comment, subscribe or become a member of the GDC Club, thank you!
    ua-cam.com/users/GameDevelopmentCenterjoin

    • @Haneen_286
      @Haneen_286 6 місяців тому

      بارك الله فيك و جزاك كل خير🤍

  • @vatan2578
    @vatan2578 4 роки тому +24

    I look forward to the continuation of your classes. I wish you and your loved ones health and happiness.

  • @brucelee7782
    @brucelee7782 10 місяців тому +5

    Finally found a beginner friendly tutorial, thanks!

  • @mikecu2249
    @mikecu2249 3 місяці тому +1

    I clicked this away 2 times because i thought this cant be rigt/up-to-date, being 3 years old. BUT this is up to date AND on Point!
    Thank you very much for this Video.

  • @jex8885
    @jex8885 Рік тому +7

    Managed to implement some smooth animation transitions in a 2D platform game thanks to this, great content!

  • @gargara123456
    @gargara123456 4 роки тому +16

    Hi, what a great tutorial series! I watched them all and I must say these are THE BEST tutorials on Godot and game development in general I watched both in youtube and Udemy. You MUST continue your lessons even in paid form, your knowledge is vast and the lessons are professionally structured. Please do more, maybe on strategy games.

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  4 роки тому +6

      Thx Delyan! I got more planned for the fall season of this year :) Never going to be paid, I believe educational content shouldn't have a price

  • @pshr2447
    @pshr2447 2 роки тому +1

    This is the best tutorial ever made on animation tree

  • @guilhermeschicovski3364
    @guilhermeschicovski3364 4 роки тому +3

    Excellent tutorial. saves several lines of code with this method making it cleaner!

  • @JeronimusJack
    @JeronimusJack 3 роки тому +1

    ty, it's awesome. i couldn't figure it out from the documentation, but i think it's more my inexperiene in statemachines with animation. details of the state are handled in that blendroom, state transition handled on an statemachine tree.

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  3 роки тому

      Yeah, the animationtree can do so much it is easy to get lost in it :)

  • @manals.a6756
    @manals.a6756 3 роки тому

    Please don’t stop doing godot tutorials!!! It’s so helpful!!! I wish you the best!!!

  • @MarioMey
    @MarioMey 2 роки тому

    "(0,1)"... Perfect! 😁

  • @hiiambarney4489
    @hiiambarney4489 Рік тому

    Def a credit to the godot community.

  • @nimaljaya5431
    @nimaljaya5431 Рік тому +1

    thanks for explaining so clearly

  • @bsavage5128
    @bsavage5128 4 роки тому +4

    I would love to see more on the Ysort method like you did for tilemaps. The coding to change sprite pictures when interacted with etc. since there is no tilemap coordinates to reference.

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  4 роки тому +1

      Yeah, I have been planning something with layered spritesheets. To reflect changing equipment for example :)

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  3 роки тому

      @@nosywendigo592 Yeah something like that gives the game a boost in immersion :)

  • @fa-pm5dr
    @fa-pm5dr Рік тому +1

    amazing. well explained, great example.

  • @salemouail627
    @salemouail627 4 роки тому +1

    wow u answered all my questions
    much love

  • @supernovafiles
    @supernovafiles 2 роки тому

    Man, I really like your tutorials!

  • @knerf999
    @knerf999 2 роки тому +1

    tyvm

  • @itsfela
    @itsfela 2 роки тому +1

    Thank you very much.

  • @johantitulaer1052
    @johantitulaer1052 2 роки тому +1

    I used to make games with the Microsoft XNA framework, and in that framework I had animations with smooth transitions between walking and idle. So when the player starts walking, it first lifts its right leg before the walking animation starts, and when you stop walking from any frame, the correct leg will retract and the player will stand idle again. Back then it was all code, but now in Godot for example I'm kind of lost on how to handle these "smooth transitions".
    I am an animation freak, I just like to overcomplicate 2d Sprite animations lol.

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  2 роки тому

      In 2d, you just need the sprites for that if you use a spritesheet. Otherwise look into 2d skeletons. Honestly, just go 3d when you go to that level. And orthographically render it with a viewport. Much easier, faster, and better results.

    • @johantitulaer1052
      @johantitulaer1052 2 роки тому

      @@GameDevelopmentCenter I'm looking for a 2d pixel look tho. So is it possible to just use a 3D model and render it as 2D pixel art? Because otherwise it's back to square one and create sprites from a 3D model again.

  • @anakdewaful
    @anakdewaful 4 роки тому +1

    woah finally animation tree, thanksss

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  4 роки тому

      Yeah, putting the concepts of the animationtree into clear wording was a challenge :)

  • @davthemillionth
    @davthemillionth 3 роки тому +1

    you can change the north south thing from around 9:00 by taking the axis labels and changing them, this can also be used to scale, but flipping is just scaling by -1 so...
    sorry if im, wrong, i haven't tried it, but it looks possible

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  3 роки тому

      I think I tried this,and other things, to no avail. It seems to be locked this way. It is quick to get used to :)

  • @kizz06
    @kizz06 4 роки тому

    very helpful and easy to understand!Subscribed!

  • @codybeach2258
    @codybeach2258 4 роки тому

    Your content is very helpful thank you for these videos.

  • @yasintonge823
    @yasintonge823 3 роки тому

    great tutorial as always.

  • @paul8028
    @paul8028 4 роки тому

    Great tutorial. Recommended.

  • @carlosflores4179
    @carlosflores4179 3 роки тому +1

    Just s recommendation, when watching on mobile, the code font is too small to see properly

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  3 роки тому +1

      92% of my viewers are on desktop, I know it is small on mobile, but really, who watched coding tutorials on mobile? Almost nobody cause there isn't enough screen real estate.

  • @Leo-xv8uq
    @Leo-xv8uq Рік тому +1

    Any Idea why i would be able to look a a diff direction while walking in another direction?
    Im using click to move btw

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  Рік тому

      Could be several reasons. From mislinking the animations in the 2d animation grid to passing the wrong blend position in code

  • @Jack-zf8ov
    @Jack-zf8ov 3 роки тому

    Great tutorial. Just a nitpick technically to align the the blend space coordinates for the animations NE,NW,SW,SE they should be placed at the respective point (-1, 0.5), (-1, -0.5), (1, -0.5), (1, 0.5)

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  3 роки тому +1

      That is incorrect as this is isometric art.
      For top-down or forward angled, you would be right :)

    • @Jack-zf8ov
      @Jack-zf8ov 3 роки тому +1

      @@GameDevelopmentCenter I still don't quite understand it

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  3 роки тому

      In isometric: y = 1/2 * x. That makes the normal vector for diagonal movement x axis biased at (0.8, 0.6)

    • @Jack-zf8ov
      @Jack-zf8ov 3 роки тому +1

      @@GameDevelopmentCenter Thank you for the help

  • @nowherebrain
    @nowherebrain 3 роки тому +1

    I think you can just change the values of -1 and 1 in the blend tree...simply put a +1 where -1 is and vice versa....I know you can change the values so...why not?

  • @christopheswiderski2026
    @christopheswiderski2026 2 роки тому +1

    For the algorithm :D

  • @mesolagic
    @mesolagic 4 роки тому +1

    Very nice tutorial man, earned my sub! Quick question though, how would you setup an animation tree to work on an enemy that moves on its own? Because you wouldn't use any user input to determine the blend position like you've done here since the enemy is moving by itself. I've currently got an npc that moves on a path using a Navigation2D node but I'm having a hard time getting that to work with my animation tree and animation player since I can't get those normalized directional values from the automatic movement.

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  4 роки тому +2

      On every physics frame you can save the current position to a value, and compare that to the position of entity on the next frame. Those are 2 Vector2, which you can compare and normalize. That would be your movement direction updated every frame as input for the blend position.

    • @mesolagic
      @mesolagic 4 роки тому +1

      @@GameDevelopmentCenter thanks! i tried this out and it's working perfectly!

  • @AlienFreak69
    @AlienFreak69 8 місяців тому

    The transitions in the blendspace are not smooth for me.
    When you change direction, it restarts the animation. Say if you go from North to NE. I use 8-directional movement and it looks very obvious that the animations are restarting. I know how to make it work in script, but I would have to avoid using the AnimationTree which is a bit unfortunate.

  • @frogmonger6916
    @frogmonger6916 2 роки тому +1

    For some reason when I press play on the walk or idle animations, they won't play. It'll show the first frame of their animation, and that's it. I'm pretty sure this is a problem with the animationplayer, but I'm not sure how to fix it. When previewing the idle or walk blendspaces, the direction updates correctly, the animation just doesn't play.

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  2 роки тому

      Join the Discord, UA-cam comment section is not a good tool to have a conversation about debugging

  • @ruslanakhmadov5870
    @ruslanakhmadov5870 3 роки тому +1

    Very nice tutorial, thank you!
    How to change blend position in animation blend space 2d with code?
    I have a points in it with animations
    Like 0 is idle frame, 0.5 is another, etc
    In viewport when I move this parameter it works perfectly for my needs. But I don't know how to manipulate it within the code
    I need to manipulate only x axis
    So I tried to create a var blend_position = $animation_player.get("parameters/blend_position")
    And then in process
    blend_position.x += 0.5
    And this doesn't have any effect

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  3 роки тому +1

      I'm not sure if I understand your questions, but based on what you are saying: 'I need to manipulate only x axis'. I think you better be using the blendspace1d

    • @ruslanakhmadov5870
      @ruslanakhmadov5870 3 роки тому +1

      @@GameDevelopmentCenter blend space 1d doesn't work for some reason, in blend space 2d i created a point higher than 0 for get rid of error and it works well in viewport

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  3 роки тому +1

      @@ruslanakhmadov5870 Well if the code I have in the tutorial doesn't change the blendposition something else is wrong. Easiest would be to post a screenshot on discord so I can help you faster :)

  • @artisanpixel
    @artisanpixel 2 роки тому +1

    How do you create this animation tree purely in gdscript if you are loading animations via gdscript and they aren't already in the editor?

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  2 роки тому

      I honestly have no experience with that, but I imagine you will have to build the animation tree after loading this animations.

    • @artisanpixel
      @artisanpixel 2 роки тому

      @@GameDevelopmentCenter no worries- I managed to figure it out after searching around and trying various things.

  • @pattyorigami
    @pattyorigami 3 роки тому +1

    Since the spritesheet in my project only has right facing frames for idle, attack, jump, etc, and I'm relying on flip_h (since it's a platformer, not top down) I can pretty much ignore the whole blendSpace2D, right?

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  3 роки тому

      I would even go as far as that you can ignore the whole animation tree node. Setting thing up in just code is probably just as much trouble. Without any major benefit.

  • @jjones503
    @jjones503 2 роки тому +1

    I've been following along without much issue, however for some reason the animations within the game aren't showing for RunNE. Somtimes It will show IdleNE instead, or it will just play the last animation again. This is the only one giving me trouble. I have checked all the points in AnimationTree, all the animations are created properly, and when I manually test the position in AnimationTree it shows the proper animation.
    Any ideas what might be causing this? The only thing i've done differnet from the tutorial thus far is bringing in my animations using the AnimatedSprite from individual files. But everything I've seen so far is indicating my animations are fine. It's just at run time, it won't play RunNE. When I run that direction and the character stops, it shows the IdleNE just fine. I'm so confused :D

  • @nanaouzumaki6044
    @nanaouzumaki6044 3 роки тому +1

    how do i make all my animations from animation player be included in the parameters of animationtree so that i can control them? is it done with statemachine with 3d?

  • @retr0dragon450
    @retr0dragon450 3 роки тому +1

    What if I wanted the animation tree to work automatically..... like for enemy ai

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  3 роки тому

      Integrate it with the statemachine you will build to implement your enemy logic

  • @pmlpvdlte2801
    @pmlpvdlte2801 4 роки тому

    Hi Sensie (i want to u call u that). Pls make a tutorial - * on mouse click (or finger touch) the enemy sprite will vanish (with animation). * Enemy sprites appearing randomly in different places.

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  4 роки тому

      Hi pmlpvd Lte, thank you for your request, but this is a very specific game feature that not many people will be looking for. I think the best thing to do for you is follow multiple tutorials for various topics. Learn the concepts and the pattern so that you can design such a specific game feature yourself :)

  • @optimojoe1589
    @optimojoe1589 4 роки тому

    i keep getting null when i use this like in the video.
    onready var playback = get_node("AnimationTree")
    onready var playback_mode = playback.get("parameters/playback")
    it only works if i put it in a function other than _ready(), _physics_process() or _process

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  4 роки тому

      Sorry for getting back to you after days OptimoJoe, UA-cam has for some reason decided not to send me updates for comments under just this one video.
      Are you sure the animationtree is in the right place on the scenetree? Maybe you got a node in between? If you want this to get faster, hop onto the discord and post a screenshot

  • @waterteafan9264
    @waterteafan9264 2 роки тому

    My animation tree is missing but its working, how to see it again, its like it became invisible

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  2 роки тому

      Won't be able to help you with this little info, join Discord and post more info

  • @snakehound7678
    @snakehound7678 4 роки тому

    love the tutorial. Is there a way to get the animation lenght or the signal of a finished animation from animationtree?

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  4 роки тому +1

      The signal comes from your animationplayer, that has an animation finished build in signal. That still functions as normal.

    • @snakehound7678
      @snakehound7678 4 роки тому

      Game Development Center thank you😍😍

  • @comradecid
    @comradecid 7 місяців тому

    great video, but please remove the video embed overlaid atop the editor... it's difficult to see what's going on, and doesn't provide helpful content

  • @danobra
    @danobra 3 роки тому

    Can one make two animations run at the same time from the animation Tree?
    For instance, using the Animation Tree to use a Run Animation and then if you press a key, you activate an item that makes fire cicle you or activates an animation that moves the character's arm from a diferent animation/sprite sheet and making the current one disappear meanwhile?
    AnimationTree seems just fine for simple things, but slightly more complicated ones already make me super lost

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  3 роки тому

      That's because in 2d your limited. The animation is nothing more than a change if image, and not a movement of a limb as you would in 3d.
      The fire circle should be possible, may be easier with a shader though.

    • @danobra
      @danobra 2 роки тому

      @@GameDevelopmentCenter funny how I'm still stuck in this very same problem and I ended up in the same video. This is so frustrating.
      I have the run cycle of my character running with his arm up and another run cycle of him running normally, but I can't make a seamless transition to the point I just feel like dropping Godot

  • @plyczkowski
    @plyczkowski 4 роки тому

    Nice tut! Btw check how melee is pronounced, it's pretty weird

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  4 роки тому

      Hahah, yeah there is a word or two, maybe three or four that I have a hard time unlearning my pronounciation on. Thank you for the feedback!

  • @subhashchandrabose315
    @subhashchandrabose315 4 роки тому

    Animeted tileset.... Like river or fire...

  • @anindyaroythetechmaster
    @anindyaroythetechmaster 3 роки тому +2

    UA-cam has this quality content for animation trees and there a channel named Miziziziz who talks like a zombie, is getting 17k views

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  3 роки тому

      Haha, oww well, guess it is a good thing I compare myself to myself yesterday and not others :) Thx for your comment Anindya! Put a smile on my face :)

  • @santoshgujar5237
    @santoshgujar5237 3 роки тому

    Sir Please can you add a Tutorial 2d racing game where vehicle move left right and background move left right, like old days, Please its a Request

    • @GameDevelopmentCenter
      @GameDevelopmentCenter  3 роки тому

      Hi Santosh, thx for the suggestion! I will put it on the list, but it won't be anytime soon. I got a couple of series I want to work on first and we have new functions of Godot 4.0 to cover in the near future as well :) Hope you understand :)

    • @santoshgujar5237
      @santoshgujar5237 3 роки тому

      @@GameDevelopmentCenter Thank you, Sir