Button functions in an experience

Hi,

does anyone know if it is possible to have a button in the experience that when tapped will re play animation timelines in the scene…so for example i scan my zap code. a button appears that says press me…I press it and the sequences starts. Then at the end of the animation, I would like to press the button again to re run the animation.

is this possible?

any help would be most welcome.

Dan

1 Like

Hi Dan,

Yes, this is possible! :slight_smile:

To play a timeline several times, you need to make sure it is reset once it has finished playing, when the “complete” event is emitted.

I would recommend that you take a look at the following tutorials: Build a Football Game in ZapWorks Studio, since it explains how to reset timelines and set them to play when buttons are pressed.

Let us know if you have any questions! :slight_smile:
Margaux

4 Likes

Thanks Margaux that really helped and the button works perfectly now! :smile:

3 Likes