Jump to content

Does destroying a sprite also destroy it's tween?


Recommended Posts

Let's say I start a tween like this:

// create sprite
let mySprite:Phaser.Sprite = this.create(300, 50, "my_atlas", "bee");

// tween sprite
let yTween:Phaser.Tween = this.game.make.tween(mySprite);
yTween.to({y: 150}, 1500, Phaser.Easing.Linear.None, false, 0, 999, true);

Does calling "destroy" on the sprite also destroy it's tween? Or will the tween be silently running in the background until it runs 999 times?

// destroy sprite (will this also kill the tween and remove it from memory?)


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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