Godot 3.1 - State Machine (Animation Tree) Tutorial

Поділитися
Вставка
  • Опубліковано 22 лип 2024
  • This video shows off the new state machine in Godot 3.1.
    Godot Alpha 2 download:
    godotengine.org/article/dev-s...

КОМЕНТАРІ • 27

  • @easyU2B
    @easyU2B 5 років тому +2

    This was really helpful! Thank you very much for the video. Also this is an awesome feature, I'm already thinking about ways I could use it. Visualisation really makes state changes clear and understandable.

  • @me2beats313
    @me2beats313 5 років тому +5

    Another sub and like:) more animation tutorials pls!)

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

    Thank you for this video!

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

    Animation in godot I think is crazy powerful

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

    extremely helpful, thank you!

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

    HI, how do we check in animationtree if a certain animation is finished playing?

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

    I know this is not a new video but for people that want to do something this simple, read on.
    you don't need any state machine for that...simply call
    AnimationPlayer.play("bounce",0.02,1,false)
    ...this is the bounce animation, then the blending in so it's not so abrupt, followed by the speed of the animation and lastly if you want to play from the end or not...I always just have that as false.

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

      I tried to apply animations on the most simple way for days and i read this OMG thank you, this is exactly what i needed

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

    how do i loop the animation in the animation tree?

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

    thx, its helpful!

  • @Xhisorz1
    @Xhisorz1 5 років тому

    pretty good

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

    Very helpful

  • @s.s.scriptties
    @s.s.scriptties 3 роки тому

    how do I make it so when I leave the key on my keyboard it stops the animation and goes back to IDLE

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

    i spent so long searching not relising the animation tree is a state machine-

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

    How do you loop an animation?(i use state machine for 3d)
    I try to play the walk animation when the up key is pressed
    However, walk animation is played only once

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

      In the animation timeline editor, there is a symbol with two arrows pointing towards each other. Just enable that, and the animation will loop as long as 'playing' is enabled. The symbol is located in the top right of animation tab, you can watch out for it in my video.

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

      @@nerdeveryday
      Thank you
      The animation loops in the timeline
      However, calling it in code does not loop. I want to loop while the key is pressed.
      Why?
      var state
      func _ready():
      state = $"Scene Root/AnimationTree".get("parameters/playback")
      state.start("death")
      func _process(delta):
      if Input.is_key_pressed(KEY_UP):
      state.travel("walk")

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

      @@aheahetaroman I think i found the problem. If you have the state machine set up to "transition : immediate" it will instantly change. Ever single time you call travel, you change, so it resets itself. To fix this, you can check with
      if state.get_current_node() != "walk":
      state.travel("walk")
      to make sure it doesn't reset while it is playing. You can also set the transition type to "at end", and it would also fix the problem, but may have different results.
      If you cant find transitions, check my video

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

      @@nerdeveryday
      Thank you
      The state machine doesn't seem to work
      It seems better to operate animationplayer programmatically
      I don't know if there is a change but I wait 3.2

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

    Hello there
    Having a problem with the codes
    " Invalid call. Nonexistent function 'start' in base 'Nil "
    Highlighting the (playback.start) line
    Same thing with travel too. I cant work with Animation tree because of 'Nil' errors
    Can anyone help me with it pls?

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

      Did you set the tree_root as a state machine? The code won't work otherwise.
      If so, you may need to initialise the playback first. It isn't a built-in variable for AnimationTree. You must first create a variable and initialise it as:
      "
      var playback
      ...
      playback = get("parameters/playback")
      "
      If you already have it initialised and it still doesn't work, check if it was done correctly (check video). Hope this helps!

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

      @@nerdeveryday I deleted the nodes and used the codes again and it worked. I must have messed up something in them cuz i had used them for other things before. Still dont understand why gave me a Nil error.
      Still your video really helped me in the matter so thank you so much ^^
      Thanks for the reply too

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

    Assisti 2 vídeos sobre o assunto e li o material no site do GODOT e não consegui ainda entender a utilidade desse troço...

  • @jwerlley
    @jwerlley 5 років тому +3

    very nice!! +1 like +1 sub

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

    Maybe you should try closing your eyes and reciting it again 😴