How do I change animation fade out time in OneShot animation?

Hi.

I am new to Godot, just started using the engine, i have some experience coding and making things in C# and Unity.

I am trying to make a simple jump animation for a Mixamo character but I am encountering a problem. I do not know how to blend the animation back into the moving state after I OneShot the jumping animation and it ends

The transition is not smooth at the end of the jumping animation. For that I tried to use AnimationNodeOneShot.ONE_SHOT_REQUEST_FADE_OUT, after I did this, i realized that the animation is not played anymore, maybe because the animation fade out time is too long? That’s why i looked for a method to change the fade out time and I found this in the documentation but the problem is I have no idea how to use it.

How do I use this?

Here is the simple function that I made for starting the animation

How can I use AnimationNodeOneShot.ONE_SHOT_REQUEST_FADE_OUT properly?

func _jump(jump_state : JumpState):
	animation_tree["parameters/" + jump_state.animation_name + "/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE
	#animation_tree["parameters/" + jump_state.animation_name + "/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_FADE_OUT

For further detail I am trying to reproduce this tutorial that I found on YouTube.

Thank you for anyone interested in helping me. I really appreciate it.

1 Like

you can click on the OneShot-Node in the animationtree and then configure the fade_out-time on the right in the inspector

2 Likes

If you want to do it via code you have to get a reference to the one shot node, and set the fadeout_time property on it. Something like:

var one_shot_node = animation_tree.tree_root.get_node("OneShot") # The name of your one shot node
one_shot_node.fadeout_time = 0.4

Also I think you have to add the requests since they’re flags (but I never used it myself so not 100% sure…)

var request_flags = AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE + AnimationNodeOneShot.ONE_SHOT_REQUEST_FADE_OUT
animation_tree["parameters/" + jump_state.animation_name + "/request"] = request_flags
2 Likes

Spent 2 hours trying to figure out how I can set up the fade out property, all this while it was in the editor all this time. Jesus.
Thank you so much.

1 Like

Thank you!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.