My animation has a main scene with 3 buttons linked to different scenes. Each of those 3 scenes has an intro animation. When I click a button from within said scenes, I want to rewind the animation before switching to the clicked scene.
In the attached file, click the first button, wait for the animation to finish. When clicking the second button or third, I would rather not switch instantly, but either play in rewind or to the end and switch after this.
Tried with JS, but have some problems with element property (it's not the clicked element but the complete scene element). And chaining mouse clicks seems to be instant, not one after the other.
The example that you are citing is timeline-based. You are working with scenes, which requires a slightly different approach: Upon click, the addressed scene is stored in the variable 'sceneToGo', and the current timeline runs backwards. In the first frame of this timeline, a JavaScript is called that checks whether the playback direction is backwards (only then will the scene change be executed).
It worked fine at first. But now after I have made all buttons clickable, scenes don't switch. I checked all actions and JS, but I don't see where the error is.
Would you be so kind and have another look at my new file?
You don't need the part of the animation that is crossed out in the screenshot. So, the part where you play the animation in reverse. That's already done by the 'setSceneToGo' script:
OMG … I feel like I had double and triple checked everything. Hate when this happens
The other maybe were not configured properly because it wasn't working before.
I kept the “outro” animation because I perhaps want to use a different (quicker) animation at the end. While it is convenient to just roll back the animation, sometimes I think it is better to switch faster to the next section.