Why animation looping is stored in cache file?

Godot Version

4.3

Question

Hi folks,

I have enabled Animation Looping in animation player and made sure it’s saved in a resource file. I verified it in another scene so things worked perfectly.

However, once I deleted .godot folder (you know, not frequently but once or twice per month?), the flag went back to disabled.

In animation import, there’s an option called Loop Mode but from the doc to me, it specifies how loop should be done, not whether looping is enabled.

It’s not a big trouble for now but with more and more animations added, it becomes a bit annoying to go through the list and click looping one by one.

Regards,
Azure

  1. Deleting the .godot folder isn’t an oil change - it’s a catastrophic recovery method. Doing it once or twice a month means you have other problems you need to solve another way.
  2. If you set an animation to loop on the Advanced Import Settings it should stay looped.
  3. You can create an Import Script to loop selected animations and attach it to a file for import. That will re-apply the looping every time it is re-imported.

Sadly the “save to external” option does not keep track of changed settings, and will be overwritten with each import, since others, or yourself from another computer may work on the same project it’s a good idea to only change import settings or use an import script. The import setting “Loop Mode” does specify if the animation should loop, ping pong, or play once, which does include whether or not looping is enabled.

1 Like

Another thing you can do if you’re not editing the model outside of Godot:

  1. Create a new scene with a Node3D as the root.
  2. Drag your .glb model (or whatever kind of model) and drop it onto the Node3D you just created.
  3. Right-click on the scene you just added.
  4. Select Make Local from the pop-up menu.
  5. Any changes you now make to the AnimationPlayer will be saved local to the scene and not get wiped out by deleting the .godot folder.

Thank you guys!

Indeed the Loop Mode in Advanced Import Settings works! I probably made mistake when checking it early.

1 Like

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