tween.js icon indicating copy to clipboard operation
tween.js copied to clipboard

When a tween is paused, it's also playing

Open chepe263 opened this issue 4 years ago • 0 comments

Considering the following code

//a new tween running for 15segs
var tween = new  TWEEN.Tween({width: 0})
	.to({width: 100}, 15000)
	.start();
	
function pause_or_resume(){
	if(tween.isPlaying()){
		tween.pause();
	} else {
		tween.resume();		
	}
}

Calling pause_or_resume the first time correctly pauses the tween. Calling the same function a second time never resumes the tween because the pause method never sets _isPlaying = false so the function isPlaying() returns true anyway

chepe263 avatar Mar 11 '20 17:03 chepe263