Timeline: Is this a bug?

0 favourites
  • 3 posts
From the Asset Store
Match same tiles with each other as fast as you can and earn more score during a limited time!
  • Been scratching my head for a few days with this one and started to realize maybe this isn't working how I think it should. But is it a bug?

    I have a 2s time line that has a keyframe at 1 second. This keyframe has a tag of "top"

    Play Timeline with tag "boost"

    ->TimelineController: On "boost" start : Execute ACTION1

    ->TimelineController: On keyframe "top" reached : Pause "boost"

    ->On KeyReleased : Resume "boost"

    Now, what is happening is when the Resume Action is triggered, the On "boost" start EVENT is triggering again. In my mind On "boost" start what when the timeline starts from the beginning only.

    I just want to make sure this isn't a bug before moving on and fixing my code.

    Thanks.

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It's difficult to tell without looking at the project, it might be a subtle bug though.

    Looking at the code, a timeline that resumes playback from the exact same position as a keyframe, doesn't trigger the keyframe reached condition.

    I am thinking that if playback is stopped when the condition is triggered, maybe the play head does not end exactly in the position of the keyframe but just before it. If that happens then when playback is resumed, it wouldn't technically be in the same position as a keyframe so the condition might be triggered the following tick.

    That's a wild guess, I would need to look at it more closely to be sure.

  • I created a quick example project.

    Hitting start will stop the timeline and start it again.

    Resume will resume the timeline from the midway point.

    The top is a counter showing each time the ->On Started event is triggered. It is triggered when the timeline is first started and when it's resumed after being paused

    dropbox.com/scl/fi/fuio7qpn91s5azb3bqu47/timeline.c3p

    I'm thinking it's working as intended, but just not totally sure :)

    Thanks.

    It's difficult to tell without looking at the project, it might be a subtle bug though.

    Looking at the code, a timeline that resumes playback from the exact same position as a keyframe, doesn't trigger the keyframe reached condition.

    I am thinking that if playback is stopped when the condition is triggered, maybe the play head does not end exactly in the position of the keyframe but just before it. If that happens then when playback is resumed, it wouldn't technically be in the same position as a keyframe so the condition might be triggered the following tick.

    That's a wild guess, I would need to look at it more closely to be sure.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)