On this page
developer_guide
Reusable vs Single Shot
By default, Anima animations are configured as ‘single-shot,’ meaning the animated node is automatically removed from the scene once the animation completes.
However, if you’re working with a looping animation, the node will remain in the scene even after the animation has looped indefinitely.
You’re also able to force a reusable animation by using as_reusable
method.
When to use reusable vs single shot
as_reusable
This method should be used when:
- we need to initialised the animation on
_ready
(see Understanding the current value) - we want to animate a node out using the same animation but played backwards
- we want to animate an animation in loop
Single Shot
This method is useful when:
- When the current value needs to be used as initial values (see Understanding the current value)
- We want to free memory once the animation completes