Timeline Finished pin is executing before timeline finishes

What I’m trying to do is when the player looks at the object the material slowly fades in to a bright green color (already done using a scalar parameter in the material) and after 2.5 seconds it will stay that color to indicate it’s been activated, but if they look away before the fade-in completes then it will fade back to it’s normal color. Once it’s “activated”, aka timeline is Finished, an animation is supposed to start. Everything seems to work perfectly fine in-game, in terms of the fading working correctly when looking at the object and looking away, but the Finished execution pin fires almost immediately when looking at the object which starts the animation, regardless of if I look away and the fading to its original color starts. Is there something that I’m overlooking?

From the way you describe it (and the way it is setup, it appears to be fine)

So correct me if i’m wrong, the update pin seems to be working correctly (fading correctly), but for some reason the finished pin is executing too quickly?

Is the blur event “undoing” or reversing the fade?

Yes, the update pin works fine and the fading works properly, in terms of when I look at and look away from the object. I see the percentage completion of the timeline increase, when looking at the object, and decreasing, when looking away at the object. I think I may not have understood how the Finished pin works earlier. Is it considered finished when it reaches either 0% or 100%? Because the Finished pin executes when it reaches either 0% (when reversing) or 100%. If that is the case, is there a way to prevent it from executing the finished pin when it reverses back to 0% from, say the middle of the timeline?

Yeah that makes sense. Could make a separate timeline for reversing. Get the value and reverse it (especially since it looks like you have a fairly easy sigmoid curve).

How exactly would I go about doing that? I tried that but both my On Focus and On Blur events execute at the exact same time, making only the first timeline execute.

Your new track is your value (from y-axis), so it would NOT go into new time (x-value / time).

actually the easiest way to do this without using a math node (finding/making the formula and calculating it manually) would be to do something like this. Stinks that finished doesn’t work in the way you need but this will be the “K.I.S.S.” answer, and it would give the behavior you want :slight_smile:

&stc=1

Thank you, KRushin, that fixed it! Hopefully this helps someone out that might be in the same situation. I wish there was a more convenient option to choose whether both 100% and 0% completion count as Finished or one or the other, hopefully down the road.

You could add an event track on the timeline that fires at 2.5. When you reverse it, do a sequence where you set new time to 2.49 and then play reverse.

Timelines output their direction, so you just check that on finished: a switch on enum node. Bingo, now you have “Finished at end” and “Finished at start” output execution pins.

1 Like

Good to know. Thanks for sharing that.

WOW! Even though this is a few years ago, this post was EXACTLY what I was looking for. I also followed MitchVRLab’s tutorial, and need a reversed gaze based interaction. My finished was ending too early as well. Thanks a lot!! :slight_smile: