Play once when scrolled into view

I have an animation that I only want to play when scrolled into view and I don’t want it to reset or play again unless the page is reloaded.

I’m currently following this method: https://help.lottiefiles.com/hc/en-us/articles/5426133805337-Play-animation-when-visible

When I use this, my animation plays when scrolled into view however any movement of scrolling will re-trigger the animation to start again. Even on the above example, the animation triggers on any scroll movements.

Has anyone found a way to stop this happening. Thanks.

Hey @Sam5

You can change the type: "play" to type: "playOnce"
Check out this doc for more information: Animation Modes - Lottie-Interactivity

2 Likes