Issue with Follower startAt

I had posted a question on stack overflow for an issue I have with starting followers.

I am using Phaser 3 and want to start a number of followers along a path. I can get this to work; however, I wanted to start then evenly spaced apart.

    drawpath(){
    let graphics = this.add.graphics();
    let path = new Phaser.Curves.Path(0, 150);
    for (let i = 0; i < 10; i++) {
        // xRadius, yRadius, startAngle, endAngle, clockwise, rotation
        if (i % 2 === 0)
            path.ellipseTo(96, 62, 135, 45, true, 0); // 180 360
        else
            path.ellipseTo(96, 62, 225, 315, false, 0);
    }
    graphics.lineStyle(1, 0xffffff, 1);
    path.draw(graphics);
    //follower(path, x, y, texture [, frame])
    for (let i = 0 ; i < 10 ; ++i) {
        let follower = this.add.follower(path, 96, 150, 'rubberducky');
        follower.setScale(0.5);
        //startFollow( [config] [, startAt])
        follower.startFollow(
            {
                duration: 10000,
                positionOnPath: true,
                repeat: -1,
                startAt: i * .1
            }
        );
    }

In the above code sample, they all start at the beginning at the same time. I Expected the startAt, would start them at a % along the path (so they would be evenly spaced from beginning to end).

1 Like

I tried this and it worked correctly. Will make an example …

The funny thing is, I was using 3.15.1
when I switched to 3.22.0 the ‘rubberducky’ image does not even show up anymore

What version were you using when it worked?

Actually 3.20.1 worked, 3.21.0 worked, 3.22.0 the sprites don’t even show up.

Use 3.21.0. v3.22.0 has bug where the follower goes straight to the end.