Have a viewport timeline animation play only once

This doesn’t really need code. You would have your action be a ‘Continue Timeline’ action. If your timeline has already played and an additional ‘Continue timeline’ action is triggered, the timeline (which is already at its end) will not run again.

Alternatively, you could use something like the the JavaScript version of this suggestion from Stephen: Set number of loops

1 Like