Dynamic update pathfollower/tween

Hello all,

How can I dynamic update path follower/tween?

Example:
I want to make the sprite to move from point A to B, next to C and finally end in B point.
How can I update from/to pathfollower/tween values during animation (by using old path without creating new one)?

Additional info:

I’ve tried with follower.stopFollow().startFollow({ from: 0, to: 0.75 }) but still no success.

Thx for the help but still is not which I need.
I need move from A to B, next from B to C in Your answer Your move is from point A to B, next from A to C. :frowning_with_open_mouth:

Please look at my example video, I’ve still have problem: sprite move to path start position when invoke startFollowing function, additionaly I’ve added dealy property (2 sec) to show better the effect.

1 Like

Thanks for Your attention and helpful examples.

The result is almost perfect but:

  • we haven’t still move from the current position (between A and B) to the new point (C) on the click
  • it looks like the sprite should build dynamic starting points (from current sprite position) to achieve our goal

Beware there’s a bug in Phaser (≤ 3.55.2) where the follower always ends on the path end instead of the from value.

1 Like

Unofrtunately after every pointerdown event the sprite comes back to the startPoint (when new startFollow config is invoked).
I’ve added delay to better show this issue.

Is it fixible?
It looks the problem related to start and end path follower.

It has to do with the positionOnPath feature but I’ve never really figured it out.

You may want to try a DIY follower where you set up the tween yourself and then update the sprite.