Navigating to a specific timeline in a scene from another scene

I have two scenes... each scene has 4 timelines... I want to navigate from Scene 2 back to Timeline 3 in Scene 1. Is this doable?

For reference Scene 1 has 4 sections.... 4A, 4B, 4C AND 4D WITH 4A Being the main timeline. I want to go from scene 2 to scene 1 - 4D.

As a bit of pedantic nomenclature: timelines aren't navigated to, timelines are played - as in started/continued. Timelines don't have state but are streams of animations that modify properties of elements on the scene.

So with that out of the way, the most straight forward way to solve this is (unfortunately) with a bit of code since Hype's editor user interface doesn't allow you to manipulate timelines outside of the current scene.

On the event that you want to trigger the scene change, you'd have a Run JavaScript… action with code like this:

// set a variable that says what timeline should be played in the next scene:
hypeDocument.customData.nextSceneTimeline = "timelineNameHere";

You will need to replace the timelineNameHere with the name of your timeline, like the 4A.

Then you'll want to chain another action (via the '+' button near the event name) after that which does the scene change.

On the receiving scene, you'll want to setup an On Scene Load action in the Scene Inspector that has a Run JavaScript… action with this code:

// set a variable that says what timeline should be played in the next scene:
if(hypeDocument.customData.nextSceneTimeline != null) {
    hypeDocument.customData.nextSceneTimeline = null;

You may also want to pause the main timeline if you have stuff there that you don't want run; you would just add this line below the one with the if:

    hypeDocument.pauseTimelineNamed('Main Timeline');
1 Like