godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.5k stars 20.26k forks source link

OneShot in AnimationTree does not return active = false when finished #39496

Open jcarlosrc opened 4 years ago

jcarlosrc commented 4 years ago

Godot version:

3.2.2-beta4

OS/device including version:

Issue description:

OneShot node in AnimationTree does not change its "valid" property to false after it finished animation. In preview it does get to false but it won't in code or inspector view.

Steps to reproduce: Create a OneShot node in an AnimationTree. Set its valid property to true in code. After its animation finishes, it is still as true.

Minimal reproduction project:

rsubtil commented 4 years ago

Can you provide a reproduction project please? It's much faster to find your issue this way.

Flavelius commented 3 years ago

This is probably related to the parameter, atleast it's what i noticed:

https://user-images.githubusercontent.com/8841352/111037430-36eb2000-8424-11eb-83f8-5002f56bf877.mp4

3.2.4.rc4.mono.official

Hiiamwilliam commented 2 years ago

Still valid in Godot 3.5.stable. It seems the AnimationNodeBlendTree doesn't update itself after an AnimationNode (in this case AnimationNodeOneShot) changes. If this is the case, maybe it could be fixed by something in the same line of https://github.com/godotengine/godot/pull/52296.

TokageItLab commented 2 years ago

Probably already fixed for 4.0 but it needs to be fixed for 3.x. it seems that in 3.5 it is working correctly internally (it return false after playback oneshot), so it is just the redraw timing issue.

ChaseAColvin commented 1 year ago

This is currently broken in 4.x, for LinuxBSD at least. I'd have to move my project over to my Windows machine to see if it is broken there too. OneShot never unsets active after animation completes..

JWBWork commented 1 year ago

Can confirm I'm seeing this behavior in v4.0.2.stable.official [7a0977ce2]

Fired off a oneShot animation and it's marked as active indefinitely - no way to know when/if the animation finished via the animationtree

lmorao commented 1 year ago

I thought I had this issue in v4.0.2, but I figured out later that it was my own mistake.

I had a Blend2 going to the shot box of the OneShot visual node. Then on the Blend2 I was connecting a run animation with a sword swing. What happened was that the run is a loop and the sword swing is a non loop. When I had the blend 2 moving only the arms for the sword swing and the blend_amount all the way to the swing, it would cast the animation once, and then keep the arms at the end of the animation of the swing, while the legs kept running.

On the other side of the OneShot, I had run again. The problem is that the shot connection was in fact a loop, so it never finished and never reset the arms.

Be careful not to put a loop on the shot section of the OneShot by mistake.

idbrii commented 11 months ago

I had this issue on v4.1.1.stable.official [bd6af8e0e] and found that I needed to enable Sync for the oneshot to be deactivated.

Select the OneShot in AnimationTree and then check this box in Inspector:

image

The sync property docs say:

If false, the blended animations' frame are stopped when the blend value is 0.

If true, forcing the blended animations to advance frame.

Neither of those settings sound like they should fix this issue, so there may stil lbe a bug here.

(I experienced it while porting the 2d/skeleton project in godot-demo-projects.)