Play to time in timeline alternative to Go to time in timeline

Would it be possible (either through javascript code, or as a future feature of HYPE) to have a button play to a time in the timeline, instead of go to time in timeline. The difference being that the scene will smoothly play from its current time code either forward or backwards to another timecode instead of the hard snap of the ‘Go to time in timeline’. This would be nice in carousels where you have buttons to jump to specific image in that carousel, instead of cycling through them with arrows.

Many thanks.

You can achieve this by using relative timelines. Just make a forum search on that…

1 Like

and ... Timeline Action timestamps in scene - #14 by MaxZieb

1 Like

thanks. I’ll take a look

There is also the Extension hypeDocument.continueTimelineNamedFromTo in the extensions project

The extension has an example that shows how to play a timeline from time # to time #

Here is a second example.

In the examples code I have add a couple of if conditions that stop a button trying to play if the time line is gone past it's destination time. ( I will probably add that part to the extension itself )

	var currentTime=  hypeDocument.currentTimeInTimelineNamed('foo1')
		var goFromTo_1 = 4
		var goFromTo_2 = 8.10
		 console.log(currentTime)
		 
if (element.id == "goFromTo1"){
		 	if (currentTime < goFromTo_1){
	 	 		hypeDocument.continueTimelineNamedFromTo("foo1", currentTime,  {timeToSeconds:goFromTo_1 , kDirection: hypeDocument.kDirectionForward})
				}
	
	 
	  }

ContinueTimelineNamedFromTo.extension v1 Example 2.hype.zip (67.1 KB)

1 Like