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.
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.
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
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.
@@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")
@@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
@@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
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?
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!
@@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
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.
Another sub and like:) more animation tutorials pls!)
Thank you for this video!
Animation in godot I think is crazy powerful
extremely helpful, thank you!
HI, how do we check in animationtree if a certain animation is finished playing?
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.
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
how do i loop the animation in the animation tree?
thx, its helpful!
pretty good
Very helpful
how do I make it so when I leave the key on my keyboard it stops the animation and goes back to IDLE
i spent so long searching not relising the animation tree is a state machine-
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
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.
@@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")
@@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
@@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
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?
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!
@@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
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...
animacoes complexas?
very nice!! +1 like +1 sub
+2/+2 :)
Maybe you should try closing your eyes and reciting it again 😴