Found key outside animation range error

Godot Version

4.3.stable

Question

Since upgrading to Godot v4.3, I randomly get the following error:

E 0:00:15:0401 _find: Found the key outside the animation range. Consider using the clean-up option in AnimationTrackEditor to fix it.
<C++ Source> scene/resources/animation.cpp:2396 @ _find()

As you notice, the error isn’t specific enough to know which node/animation caused it. I did manage to reproduce the error in my game, and found an enemy, whom upon destroying gives this error. But the error only appears roughly 50% of the time.

So I looked through ALL animations in the enemies scene, paying specific attention to the destroy animations that seem to correlate to the error. I can’t find any key frames outside the animation range…

I also tried the “Clean up animation” command, but still see the error popping up.

So, 2 questions:

  1. what does the range refer to? I am assuming the timeline duration, but realize this could mean something different.
  2. Has anybody else seen this bug?
3 Likes

I also had this bug.

I have encountered the error too. In my case, I tracked it down to an audio clip in the animation. The cause seemed to be that the clip started at a non-zero frame, which I assume is a bug.

Some hacky workarounds to trigger the audio clip in some other way, such as adding it to another animation player at frame 0 and play the animation clip at the desired time instead. Or use a call method track that plays the audio.

Another very hacky workaround I found is if I add an audio clip at frame 0 in the same track (without any resource attached) it doesn’t show any errors.

I also have this error - and I believe it is also related to an audio issue - but, I am also having a hard time pinpointing the solution.

Edit - I believe I’ve found it! So far since fixing this tiny microsecond of audio over hang, I haven’t pulled an error. I’ll let you know if it reappears.
Screenshot 2024-09-07 082811

2 Likes

I get the same problem. For me it is 3D keyframe animation. I did that on purpose. Is there a way to allowing it like that? because I need to cleanup everytime I update the animation from blender.

I had the same error with an enemy.
It finally went away after I increased the Max Polyphony on the AudioStreamPlayer2D.

1 Like

This keeps happening to me at complete random. Absolutely nothing is outside the animation range, the AudioStreamPlayer2D has a max_polyphony set to 32 (which is already way too much imo) and it’s still giving me the same error. This must be an engine bug in some ways, I guess I just need to create a MRP and post it as a GitHub issue.

I seem to be having this problem as well - I’ve gotten multiple reports from players of my game crashing with this error during shader precompilation. It happens to them consistently to the point where they can’t play the game at all, but I can’t reproduce it on my end whatsoever. Checked all the animations in every scene, nothing out of the ordinary. Great stuff.

1 Like

This is still an issue to this day, nobody seemed to have made a proper GitHub issue because it’s impossible to reproduce in a clean project, but now it reached a point where it actively prevents me from making progress with my game.

So, I am the OP of this topic. I was able to clear some of the errors by making sure I had no audio tracks that extended past the animation duration as a previous commenter - @conorfmt2 - motioned.

Regardless, I still ran into this error occasionally.

But, I found a fix, so far things are looking good.

The offending bit was this:

I had another animation clip playing whose length MATCHED the length of the animation calling it. So, in this example you can see my “destroy” animation clip has the same length (1.0sec) as the animation that is playing it.

What worked for me: Shorten the “destroy” animation by a fraction of a second. I had to go to the animation player that the destroy animation belongs to, find the animation, shorten it.

When I go back to my parent animation that is calling it it now looks like this:

And that fixed the last remaining “Found key outside animation range” error I had.

\(〇_o)/