# Do I need to remove a tween on autoComplete()

**URL:** <https://phaser.discourse.group/t/do-i-need-to-remove-a-tween-on-autocomplete/5940>\
**Category:** Phaser 3\
**Created:** [April 17, 2020, 2:58pm UTC](https://phaser.discourse.group/t/do-i-need-to-remove-a-tween-on-autocomplete/5940 "2020-04-17T14:58:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![daveo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/daveo/32/3184_2.png) [@daveo](https://phaser.discourse.group/u/daveo)\
**Post date:** [April 17, 2020, 2:58pm UTC](https://phaser.discourse.group/t/do-i-need-to-remove-a-tween-on-autocomplete/5940/1 "2020-04-17T14:58:54Z")

</div>

Hi! My name is daveo  
I am writing a very simple Phaser tutorial and I cannot determine if I need to remove a tween after it completes to conserve memory. In my case, I will not need to re-use the tween after it completes… here is my code and I am making an assumption that the tween should be removed on completion:

```javascript
	whoseTurnIsIt() {
		let x = this.game.config.width / 2;
		let y = this.game.config.height / 2;
		let t = this.whoseTurn = PLAYER_X ? "PLAYER X" : "PLAYER_Y";
		
		let label = this.add.text(x, y, t, 
			{ fontSize: '32px Arial', fill: '#000' });
		label.setOrigin(0.5, 0.5);

		let tween = this.tweens.add({
			targets: label, 
			alpha: 0,
			ease: 'Power1',
			duration: 2000, 
			onComplete: this.turnTweenComplete,
			onCompleteParams: [label]
		});
	}

	turnTweenComplete(tween, targets, params) {
		tween.remove();
	}
```

Thanks very much!

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [April 17, 2020, 3:17pm UTC](https://phaser.discourse.group/t/do-i-need-to-remove-a-tween-on-autocomplete/5940/2 "2020-04-17T15:17:51Z")

</div>

👋 No.

---

<div class="post-metadata">

**Author:** ![daveo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/daveo/32/3184_2.png) [@daveo](https://phaser.discourse.group/u/daveo)\
**Post date:** [April 17, 2020, 3:30pm UTC](https://phaser.discourse.group/t/do-i-need-to-remove-a-tween-on-autocomplete/5940/3 "2020-04-17T15:30:58Z")

</div>

Thanks for your answer, samme!  
I initially marked it as the ‘solution’ but after thinking about it…

I guess my concern is I am creating a new tween every time I call ‘whoseTurnIsIt()’. This will be called every time a ‘tic tac toe’ square is clicked.  
So, if I keep calling ‘this.tweens.add()’ for every click event then won’t it use up memory since the created tween is never removed? Or are you saying it is automatically removed at ‘onComplete()’… because there is also a ‘restart()’

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [April 17, 2020, 3:39pm UTC](https://phaser.discourse.group/t/do-i-need-to-remove-a-tween-on-autocomplete/5940/4 "2020-04-17T15:39:36Z")

</div>

Phaser removes them automatically once complete.

---

<div class="post-metadata">

**Author:** ![daveo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/daveo/32/3184_2.png) [@daveo](https://phaser.discourse.group/u/daveo)\
**Post date:** [April 17, 2020, 3:40pm UTC](https://phaser.discourse.group/t/do-i-need-to-remove-a-tween-on-autocomplete/5940/5 "2020-04-17T15:40:52Z")

</div>

thanks, pal!
