Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object disappears when Tween duration is zero #4235

Closed
BigZaphod opened this issue Dec 15, 2018 · 1 comment
Closed

Object disappears when Tween duration is zero #4235

BigZaphod opened this issue Dec 15, 2018 · 1 comment

Comments

@BigZaphod
Copy link
Contributor

BigZaphod commented Dec 15, 2018

Version

  • Phaser Version: 3.15.1
  • Operating system: macOS 10.14.2
  • Browser: Safari 12.0.2

Description

When a tween's duration is 0, the object being animated disappears.

Example Test Code

Using https://labs.phaser.io/edit.html

var config = {
    type: Phaser.AUTO,
    width: 800,
    height: 600,
    parent: 'phaser-example',
    scene: {
        preload: preload,
        create: create,
    }
};
var game = new Phaser.Game(config);

function preload () {
    this.load.image('block', 'assets/sprites/block.png');
}

function create () {
    var image = this.add.image(200, 300, 'block');
    this.tweens.add({
        targets: image,
        x: 300,
        duration: 0
    });
}

Change the duration to anything greater than 0, and it works - but when duration is 0, the sprite just disappears instead. I'd expect it to just jump to the end of the tween instantly if the duration is 0.

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants