Godot: AnimationPlayer "Loop" property working sporadically

Created on 23 Jan 2019  路  25Comments  路  Source: godotengine/godot

Godot version:
3.1 beta 2

OS/device including version:
Windows 10

Issue description:
AnimationPlayer not respecting the "loop" setting. Plays animation only once. I've tried setting the loop property via code as well to no avail.

Steps to reproduce:
Setup an animation that is supposed to loop. Seems to work sporadically. Sometimes it will loop correctly, but most times it will not.

Minimal reproduction project:
I noticed it while going through this tutorial, so here's the project I've got so far.
Zeldalike-Tutorial.zip

bug confirmed core

Most helpful comment

Aha, I can reproduce it on Windows

All 25 comments

I ran the reproduction project but couldn't see anything wrong. Where exactly is it going wrong?

When I move the player sprite around, the animations don't seem to be looping. They play once and do not continue playing. I recreated the project on the stable 3.0.6 release and it worked as expected.

Are the animations playing and looping correctly for you?

@Ceryni It seems to loop fine for me

@DualMatrix I'm not sure what to say...but it's not working on mine. This is a fresh import of the attached project.
nolooping

As you can see, it loops at first, but after subsequent inputs it does not.

I can confirm this in a recent master build from yesterday. Most likely a bug, can't find anything wrong with the setup, even tried changing the processing to physics.

The animation in game reports that it is running and gives times. However, the properties on the Sprite indicate it changes once and gets trapped. (Seems to be on any property)

image

This is even visible my AnimationPlayer. I can only get it to play again by doing a restart on the animation, but while it is loop it doesn't animate.

ezgif com-video-to-gif 2

Maybe some issue with the loop?

This poor 3.1 AnimationPlayer. I don't think it liked the rewrites. X)

@akien-mga It probably should be aimed for 3.1, it may mean that no looping animations for any users that run into this until 3.2.

@Ceryni Does setting the AnimationPlayer playback speed of 3.0 fix the problem on your end?

I think the problem might be to do with the speed.

@avencherus Confirmed, switching it to 3.0 fixes it and going back to 4.0 makes it break again.

Tried 2,3,4,5,6, Only multiplier that had issues was 4.

Can't reproduce in 88a36e20 on Linux, so assuming fixed.

Please comment if you can still reproduce the issue.

@akien-mga Was not fixed. It seems to occur less easily, but still happens for me in Windows 10 64-bit as of a32b26d.

ezgif com-video-to-gif 1
ezgif com-video-to-gif

Weird. Might be Windows specific?

No, took a look just now. On my laptop using Ubuntu 18.04.1 LTS, I also have that odd stalling of the animation when changing directions, and the AnimationPlayer can hiccup as well, though less often.

I can't reproduce this at all, will have to test on Windows..

Aha, I can reproduce it on Windows

@reduz
Using Beta10 and Windows10 64bit.
For me the "Animation Looping" when ticked in the animation editor and click the play animation button, it will loops. But if I click on Play Project or Play scene, it wont loops. If I close the project and reopen it back the "Animation Looping" is not ticked. The "Autoplay on load" is working just fine.

You shouldn't see the changes in beta10, this commit happened about 15 hours after beta10's.

@avencherus Yep it definitely looks like the same issue but in my case I found a work around by setting the step value to 0.1.

@jesperkondrup Odd, I'll have to keep an eye out for this. Was it editor side only? Since the step is for keyframe snapping.

@avencherus I just took a look and it seems that this is only happening in the editor.

I am not comlpetely sure if this is related but recently we had this issue in some of our animations (in 3D) that some animations that triggered other animations would not play the triggered animation - BUT this was only happening the first time the animation was played. All the subsequently times the animation was played it triggered the subanimations just fine.

This time the step value fix of using 0.1 instead of 0.01 did not work but instead we made a call method track and added the animation that should be triggered through there. This seems to do the trick and now it works every time.

So what is the difference between calling the animation where you can see the track in the timeline and the method track? It would seem the Method track is more reliable when you want to trigger an animation?

Also my colleague on linux cannot reproduce the issue (I am working on Windows 10).

Facing the same issue on ubuntu with godot 3.2.2
Looping doesn't work when i keep holding the input but works when i keep pressing & releasing the key

Maybe worth reopening then?

Having the same issue in 3.2.3.stable. Win 10 Pro x64. Looped animations play fine in the editor but in the game they play once then stall. If I set get_animation(name).loop = true in code then it honours it. I've attached a minimal reproduction project.
AnimationLoopIssue.zip

Having the same issue in 3.2.3.stable. Win 10 Pro x64. Looped animations play fine in the editor but in the game they play once then stall. If I set get_animation(name).loop = true in code then it honours it. I've attached a minimal reproduction project.
AnimationLoopIssue.zip

This seems like a different issue, one related to .glb imports.

It looks like the problem in your sample project is that changing loop properties in the editor aren't acknowledged when using an .glb import. From what I can tell no edits or additions to keyframes appear to be stored either.

The expectation might be to change these things from the source and reimport it. I couldn't speak to the intended ability of the AnimationPlayer to take the data and modify these files from the editor. If it's a bug you should open a new issue, but if not, it might be a feature request to allow AnimationPlayer to backwards modify these special import files.

If you make the scene local, these editor changes in the AnimationPlayer become possible, as the data is then captured in the .tscn file from then on.

It does becomes a rather large text file at that point.

image

This seems like a different issue, one related to .glb imports.

Just to be sure, I tested it with .gltf but the issue remains the same.
However, the -loop sufix seems to work in any case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ndee85 picture ndee85  路  3Comments

SleepProgger picture SleepProgger  路  3Comments

n-pigeon picture n-pigeon  路  3Comments

mefihl picture mefihl  路  3Comments

timoschwarzer picture timoschwarzer  路  3Comments