Timeline triggering events too early

I have a Timeline using Signal Receiver to trigger various methods. However the first method is called immediately on page load unless I place the signal event at frame 6 (0.1s) or later. I have verified that timeline.time == 0 at page load but the event is still triggered.

And side note: I was unable to pass strings through the Unity UI into my js methods, so I had to create individual Signal tracks for each event. Should I be able to send strings through a Signal Receiver? Or is there a better way to trigger methods on a timeline?

Thanks!

Original Post on Discord

by user 300386587278049291

Hey, yes strings should work too.
Do you think you could provide a little example scene?

I can try to put something together later- heading out the door at the moment

by user 300386587278049291

Ok, thank you!

I think I found the problem in line 677-680 of TimelineTracks.js

by user 300386587278049291

const abs = Math.abs(td);
if (abs >= .00001 && abs < .1) {
  isActive = true;
}

by user 300386587278049291

this also explains why further events felt slightly early

by user 300386587278049291

0.1 at 60fps is a few frames. Another approach might be to get a frame length and check if the abs(td) is between that range

by user 300386587278049291

my temp solution is to mark the clip as Retroactive which relies on:
isActive = td <= 0.000001;

by user 300386587278049291

You’re right, that’s a bit sloppy there.

I still have the string issue but the early timing issue was more pressing for this project - i’ll still try to get an example in the coming days

by user 300386587278049291

I’ll try to reproduce it later too

Should be relatively straightforward (I hope)

cool thanks!

by user 300386587278049291

The missing argument reproduces! :slightly_smiling_face:

Added support for arguments! It was actually missing / not exported for signal events

Ok cool thanks! Is Signal events the best way to do what I’m doing? Triggering methods along a timeline?

by user 300386587278049291

I think that’s a great usecase for them, sure.

For our website we have added custom timeline tracks to modify html state, so that is also possible. The code for those tracks is here: GitHub - needle-tools/needle-engine-modules