Skip to content

Timeline Events set to once break timeline #7147

@TomorrowToday

Description

@TomorrowToday

Version

  • Phaser Version: 3.88.2
  • Operating system: MacOS 15.4.1
  • Browser: Chrome 136.0.7103.114 (Official Build) (x86_64)

Description

Multiple timeline events with once set to true, silently break the timeline and prevent all future events from firing.

Example Test Code

sandbox

class Example extends Phaser.Scene
{

    create ()
    {
	const timeline = this.add.timeline();
		
        for (let i=0; i<50; i++) {
            timeline.add({
                at: i * 20,
                once: true, // comment out to get to fin
                run: () => console.count('event #')
            });
        }

	timeline.add({
	    from: 1000,
            run: () => console.log('fin')
	});

	timeline.play();
    }
}

const config = {
    type: Phaser.AUTO,
    width: 800,
    height: 600,
    backgroundColor: '#2d2d2d',
    parent: 'phaser-example',
    scene: Example
};

const game = new Phaser.Game(config);

Additional Information

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions