Javascript triggered sub-timeline restarts main timeline? (75.0 KB)

Attached is a scene from an animation I’m working on. I have a timeline called BlinkH which makes the character on the left blink his eyes. Rather than me triggering this multiple times in the main timeline, I thought it would be better to trigger this repeatedly at random intervals via a javascript function in the main timeline.

I’m getting unexpected behaviour. Firstly, the javascript seems to reset the main timeline to 0 because the console logs every 1 second which is where the script is set to run in the main timeline. This means that the main timeline simply repeats the first second and I never get to the 5th second where I have a button fading in.

The blink never happens.

It could be bad javascript in my function or something about timelines that I’m missing. Either way though, it makes no sense to me that the main timeline would play fine until javascript triggers another timeline. If I do this manually with a timeline action triggering another timeline BOTH the main timeline and the sub-timeline play simultaneously. That’s what I thought would happen here.

TIA for any advice with this.


timelineName is case sensitive. Means ‘blinkH’ is not ‘BlinkH’.
As default Hype never logs such occured error … which stops functionality in your case.

1 Like

thanks… yep that did it.

Why doesn’t Hype log errors with variables it can’t find? I have to admit, had it done this, I probably would have caught the error.

I’ve put on our todo list to be better about logging errors like this; thanks!