Jump to content
Search Community

Strange behaviour in LinePath2D

protoemocional test
Moderator Tag

Recommended Posts

Hello,

 

I have spotted strange behaviour using LinePath2D in conjunction with SteppedEase and useFrames turned on. It basically avoids state 0 of the LinePath2D when you step once per frame. Please see the attachment.

 

Is this intended behaviour? How can it be solved?

 

Thanks in advance.

Link to comment
Share on other sites

That's actually expected behavior, but I can see why it would seem odd at first. Let me explain with an illustration:

 

render-illustration.gif

 

So the red dashes represent when the tween renders. If your tween is 8 frames long (duration), there's an amount of time between each frame render, right? In your FLA, it's 1 second. If your 8-frame tween repeats 3 times, it should take 24 seconds (3 x 8). So imagine you're the playhead and you land at the end of the tween, at exactly the 8th frame. Now you need to loop. Where would you render next? Technically even 0.0000001 seconds after the 8-second spot, the tween would jump back to the beginning of the tween and measure it from the zero position. So 1 second (or frame) after frame 8, you'd arrive back at frame 1. See the issue? It shouldn't render at 0, otherwise the tween would actually take 9 seconds the second time around. Imagine duplicating the tween timeline graph and putting 3 in a row, one-after-the-other. The zero position on the 2nd tween would actually be identical to the 8-second/frame spot on the first tween.

 

The solution? You could just make the duration 8.999999 so that by the time it reaches the 9 spot, it is actually looped around to the very beginning (zero).

 

Make sense? This is one of those things that's actually quite logical when you see it laid out but it can be confusing initially.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...