I removed the looping for the attack animations and I was still having issues. I printed the animation names at the start and end signals of the animation tree and saw that the idle animation was being fired immediately after the attack, cutting it. So I changed in the animation tree "Auto" to "Disabled" in "Advance mode" in the Attack node of (the arrow UI), that fixed it
If you're having the issue where the attack animation continues playing, it could be because your attack animations are still looping. There are three options in looping animations. There are two that look like swirly arrows, one where the arrows are blue, and one where they are not, And one that kinda looks like this |---| Don't use that one. Use the arrows that are not blue. By verifying this, I was able to get the AnimationTree Node to throw _on_animation_tree_animation_finished(anim_name: StringName). Godot 4.3
i counted 4 separate, and meaningful clicks and a slight of hand ctrl+s within 2 seconds and all you said is " turn this off and see if it works"(with no explanation of what you clicked to turn what off) to a fluent user thats not a problem, first time user of this program and i had to watch the same 3 seconds back 5 times.... its going to take us HOURS to get through the video, it wont hurt you to slow the pace just a bit. its a BEGINNERS tutorial, not an intermediate or casual users tutorial.
The AnimationTree signal doesn't work for me on Godot 4.2.2 (it never triggers), so I used a Timer with 0.55 wait_time that attack input starts. Using the timeout() signal, I turn attacking to false. The timer also doubles as a CD for attacking so it isn't even a workaround, but a different way to handle the situation with positive side effects.
for a 3D Character it seems completly different. First of all you need to create a "State Machine" Node in the AnimationTree Editor. Then you can create the state machine. I dont know where the state machine in this video comes from its not shown. also the .travel function seems to be somewhere else as the AnimationStateMachinePlayback does not have a function ".travel()": "anim_tree.get("parameters/StateMachine/playback").travel(...)" does not work
Hi, i just want to ask if you still need to multiply delta into velocity. To my knowledge, delta is already taken care by the engine for Velocity. That's the reason why you need 5000 speed to not move slowly, its because you essentially multiply delta twice.
So you have to have all your animations set up in the animation player before hand ? This just gives more room to adjust details, animation flow etc? I wanna make sure I understand correctly. Say I want to make a beat em up style side scroller. I have "attack1" and I connect it to "attack2" same input different animation. Will this work to create a combo effect and then allow me to change the DMG value of the second attack ?
Hey while this tutorial is great I feel I might be a bit lacking, as I followed along but once my player attacks it can no longer move and I get an error stating "AnimationNodeStateMachinePlayback: parameters/playback" essentially telling me its cutting the animation as a result detecting one or more looped transitions. I double checked to see if I left anything on loop but I haven't so I'm unsure where I've mistepped. Does anybody have any idea where I went askew?
See my comment. You are probably having the same issue I did where the AnimationTree signal never fires. Throw a print statement in that func and see if it ever prints. That's the fastest way to check a function gets called or not. You can also use the debug tool of course.
@@boswellsoccer You Sir are a wonderful being. Thank you and that did put me on the right track to solving my issue. I do have to wonder what animation is looped that is negating the AnimationTree Signal from working as intended to begin with.
@@trapdoort3297 I suspect it is the Attack to Idle Advance prop being set to Auto. It seems the engine views this as a queue and doesn't send the animation_finished signal after Attack because Idle is queued up. And Idle loops, which also disables the signal. Double womp
When moving down and attacking, the attacking flag is set to true, but does not play, and then not automatically turned off. When this happens, all movement is disabled, as expected. However, this issue does not happen with any other direction. Does anyone have any thoughts on what the issue could be? I saw the comment about using a timer, but I'd rather identify the issue with moving down and attacking as all other directions are working.
For myself, I didn't realize that the looping toggle on the attack animations has more than just an "on" and an "off" setting, there's a third one as well, which I had accidentally selected. Fixed it for me once I noticed that.
Does someone have a good explanation for AnimationTree: Animation Blendspace1d Blendspace2d BlendTree StateMachine Why use blendtree, instead of a blendspace2d or Animation for a top down 2d rpg?
BlendSpace1D: Best for animations that vary along a single axis (e.g., walking speed) Smoothly interpolates between animations based on a single parameter BlendSpace2D: Ideal for animations that depend on two variables (e.g., movement direction and speed) Allows for more complex blending in a 2D space BlendTree: Offers the most flexibility for complex animation logic Useful for creating custom blending behaviors and hierarchical animation structures StateMachine: Perfect for distinct animation states with clear transitions (e.g., idle, walk, jump) Provides a clear visual representation of animation flow and logic Choice depends on the complexity of your animations and the number of variables affecting them. StateMachine is great for overall animation control, while BlendSpaces and BlendTrees offer more nuanced blending within states.
please slow your mouse cursor down. you move it SO MUCH i cannot keep track. i literally have to slow playback to .5 speed to see where youve clicked half the time. take your damn hand off the mouse while you talk. its like following a schizophrenic mouse down a hallway of mirrors.
Great tutorial! Never thought I'd miss Unreal's transition rules. Never done it in code actually, so this was refreshing
I removed the looping for the attack animations and I was still having issues. I printed the animation names at the start and end signals of the animation tree and saw that the idle animation was being fired immediately after the attack, cutting it. So I changed in the animation tree "Auto" to "Disabled" in "Advance mode" in the Attack node of (the arrow UI), that fixed it
If you're having the issue where the attack animation continues playing, it could be because your attack animations are still looping. There are three options in looping animations. There are two that look like swirly arrows, one where the arrows are blue, and one where they are not, And one that kinda looks like this |---| Don't use that one. Use the arrows that are not blue. By verifying this, I was able to get the AnimationTree Node to throw _on_animation_tree_animation_finished(anim_name: StringName). Godot 4.3
thank bro❤
i counted 4 separate, and meaningful clicks and a slight of hand ctrl+s within 2 seconds and all you said is " turn this off and see if it works"(with no explanation of what you clicked to turn what off) to a fluent user thats not a problem, first time user of this program and i had to watch the same 3 seconds back 5 times.... its going to take us HOURS to get through the video, it wont hurt you to slow the pace just a bit.
its a BEGINNERS tutorial, not an intermediate or casual users tutorial.
You are the best and you are successful 😀
Idk if I'm successful yet but thank you 😂
The AnimationTree signal doesn't work for me on Godot 4.2.2 (it never triggers), so I used a Timer with 0.55 wait_time that attack input starts. Using the timeout() signal, I turn attacking to false. The timer also doubles as a CD for attacking so it isn't even a workaround, but a different way to handle the situation with positive side effects.
yeah for sure! thats a really creative solution. Good work!
for a 3D Character it seems completly different.
First of all you need to create a "State Machine" Node in the AnimationTree Editor. Then you can create the state machine. I dont know where the state machine in this video comes from its not shown.
also the .travel function seems to be somewhere else as the AnimationStateMachinePlayback does not have a function ".travel()": "anim_tree.get("parameters/StateMachine/playback").travel(...)" does not work
ah there are different Tree Roots for the Animation Tree. That makes sense
Hi, i just want to ask if you still need to multiply delta into velocity. To my knowledge, delta is already taken care by the engine for Velocity. That's the reason why you need 5000 speed to not move slowly, its because you essentially multiply delta twice.
Hello there, do u happen to know how can I change the speed_scale in the new animation_tree?
You life saver❤ tnx bro
So you have to have all your animations set up in the animation player before hand ? This just gives more room to adjust details, animation flow etc? I wanna make sure I understand correctly.
Say I want to make a beat em up style side scroller. I have "attack1" and I connect it to "attack2" same input different animation. Will this work to create a combo effect and then allow me to change the DMG value of the second attack ?
if you want to use animtree, then yes. otherwise its up to you.
@@CodingQuests thank you
Hey while this tutorial is great I feel I might be a bit lacking, as I followed along but once my player attacks it can no longer move and I get an error stating "AnimationNodeStateMachinePlayback: parameters/playback" essentially telling me its cutting the animation as a result detecting one or more looped transitions. I double checked to see if I left anything on loop but I haven't so I'm unsure where I've mistepped. Does anybody have any idea where I went askew?
See my comment. You are probably having the same issue I did where the AnimationTree signal never fires. Throw a print statement in that func and see if it ever prints. That's the fastest way to check a function gets called or not. You can also use the debug tool of course.
@@boswellsoccer You Sir are a wonderful being. Thank you and that did put me on the right track to solving my issue. I do have to wonder what animation is looped that is negating the AnimationTree Signal from working as intended to begin with.
@@trapdoort3297 I suspect it is the Attack to Idle Advance prop being set to Auto. It seems the engine views this as a queue and doesn't send the animation_finished signal after Attack because Idle is queued up. And Idle loops, which also disables the signal. Double womp
i cant get one tutorial to work in any context i don't get it doing this for weeks nothing works
When moving down and attacking, the attacking flag is set to true, but does not play, and then not automatically turned off. When this happens, all movement is disabled, as expected. However, this issue does not happen with any other direction. Does anyone have any thoughts on what the issue could be? I saw the comment about using a timer, but I'd rather identify the issue with moving down and attacking as all other directions are working.
For myself, I didn't realize that the looping toggle on the attack animations has more than just an "on" and an "off" setting, there's a third one as well, which I had accidentally selected. Fixed it for me once I noticed that.
Does someone have a good explanation for AnimationTree:
Animation
Blendspace1d
Blendspace2d
BlendTree
StateMachine
Why use blendtree, instead of a blendspace2d or Animation for a top down 2d rpg?
BlendSpace1D:
Best for animations that vary along a single axis (e.g., walking speed)
Smoothly interpolates between animations based on a single parameter
BlendSpace2D:
Ideal for animations that depend on two variables (e.g., movement direction and speed)
Allows for more complex blending in a 2D space
BlendTree:
Offers the most flexibility for complex animation logic
Useful for creating custom blending behaviors and hierarchical animation structures
StateMachine:
Perfect for distinct animation states with clear transitions (e.g., idle, walk, jump)
Provides a clear visual representation of animation flow and logic
Choice depends on the complexity of your animations and the number of variables affecting them. StateMachine is great for overall animation control, while BlendSpaces and BlendTrees offer more nuanced blending within states.
so basically godot made it really really easy to make a state machine so long as you use the animations to do it, lol.
not exactly no. bcuz state machines are controlled through code as well. Youll see later on in the series what i mean :)
please slow your mouse cursor down. you move it SO MUCH i cannot keep track. i literally have to slow playback to .5 speed to see where youve clicked half the time. take your damn hand off the mouse while you talk. its like following a schizophrenic mouse down a hallway of mirrors.