Jump to next scene, current time

I am attempting to make a hype project that allows the user to scroll through the timeline, but also allows them to ‘play/pause’ the timeline. I am attempting to do this with two very similar scenes. One plays the animation back and forth, and the other pauses and gives control to the user. I was hoping to be able to use the timestamp of the current scene and jump to that same time in the next/previous scene. Currently it just jumps to a preset time (the beginning). Can anyone point me in the right direction? Am I complicating my approach?

basic slices.hype.zip (47.1 KB)

i guess you could do a one-liner on scene unload (first scene):

hypeDocument.customData.currentTime = hypeDocument.currentTimeInTimelineNamed('Main Timeline')

and one on scene load (second scene):
hypeDocument.goToTimeInTimelineNamed(hypeDocument.customData.currentTime, 'Main Timeline')

3 Likes

Thank you so much! That works!

Ideally I would like it to preserve the timeline direction, but this might be enough javascript for one day.

if you take a look …
Hypes API provides such methods.

1 Like