godot icon indicating copy to clipboard operation
godot copied to clipboard

OneShot in AnimationTree does not return active = false when finished

Open jcarlosrc opened this issue 4 years ago • 5 comments

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:

jcarlosrc avatar Jun 13 '20 04:06 jcarlosrc

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

rsubtil avatar Jun 13 '20 11:06 rsubtil

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

Flavelius avatar Mar 13 '21 16:03 Flavelius

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.

Hiiamwilliam avatar Aug 15 '22 20:08 Hiiamwilliam

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.

TokageItLab avatar Aug 31 '22 08:08 TokageItLab

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..

ChaseAColvin avatar Nov 27 '22 19:11 ChaseAColvin

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

JWBWork avatar Apr 23 '23 23:04 JWBWork

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.

lmorao avatar May 28 '23 14:05 lmorao

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.)

idbrii avatar Oct 08 '23 08:10 idbrii