Ninjadoodle Posted March 22, 2018 Share Posted March 22, 2018 Hi @enpu When I remove a sprite created from a class ... enemy.sprite.remove(); ... any tweens/onComplete events continue triggering even tho the sprite is gone. Is this expected behaviour and do I need to remove the sprite / tweens in some other way? Quote Link to comment Share on other sites More sharing options...
enpu Posted March 22, 2018 Share Posted March 22, 2018 @Ninjadoodle Yes that is expected, sprite.remove() just removes the sprite from it's parent, so it doesn't get rendered anymore. You should also stop all the tweens. Just call the stop function on all the tween instances, or use the game.Tween.stopTweensForObject Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 22, 2018 Author Share Posted March 22, 2018 @enpu Thanks, that works , but now I'm having another issue - posted in new topic. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.