Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17079

How to delay one line of code?

$
0
0

@efares wrote:

I have a physics sprite that I want to remove from it's parent AFTER I run some animation on it.
So this is what I have:

this.object.sprite.runAction(this.animateExplosion);
this.object.removeFromParent();

What is the best way to delay the removeFromParent line until the runAction animation is done running (going through all the frames) which is less than a second. Should I use sequence? Should I use setTimeout? Use something else?

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 17079

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>