Can I make spawned objects delete after a certain time

For topics that don't fit under the other topics or forums.

Can I make spawned objects delete after a certain time

Postby lethalsquirrel » Tue Aug 17, 2010 1:18 am

Basically, I,m trying to make a missile that when it explodes, the circles that are spawned die/delete after a certain amount of time. i have the explosion looking nice, but in never goes away.
User avatar
lethalsquirrel
[ex-squirl]
 
Posts: 54
Joined: Fri Sep 11, 2009 5:03 am

Re: Can I make spawned objects delete after a certain time

Postby Mystery » Tue Aug 17, 2010 9:09 am

The easiest method available is to simple add the good old
Code: Select all
e.this.density = 0


Although to make a timer gets harder very quickly, if you're using the current version of Algodoo (Non Beta) You can create a dynamic property that will delete the object after a time limit or with a variable.
viewtopic.php?f=13&t=1322

Although if you are brave enough to use the beta version you may be able to use the geval function.
viewtopic.php?f=13&t=2356
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: Can I make spawned objects delete after a certain time

Postby Matten » Tue Aug 17, 2010 11:33 am

You can also make the spawned circle a little transparent (like 0.99) and spawn a laser inside it. Then you can put a timer script in the onHitByLaser of the ball
Cave Johnson wrote:Do you know who I am? I'm the man who's gonna burn your house down! With the lemons! I'm gonna get my engineers to invent a combustible lemon that burns your house down!
User avatar
Matten
 
Posts: 435
Joined: Mon Apr 05, 2010 2:03 pm
Location: The Netherlands

Re: Can I make spawned objects delete after a certain time

Postby lethalsquirrel » Wed Aug 18, 2010 4:49 am

thanks for the help :)
User avatar
lethalsquirrel
[ex-squirl]
 
Posts: 54
Joined: Fri Sep 11, 2009 5:03 am


Return to Algodoo in general

Who is online

Users browsing this forum: No registered users and 5 guests