Delete after ___ seconds
4 posts • Page 1 of 1
Delete after ___ seconds
I was just wondering whether it was possible to delete a shape after a defined number of seconds/ticks through use of Thyme. If so, how would one implement this?
-

Fujitsu - Posts: 328
- Joined: Tue Sep 01, 2009 12:28 am
- Location: Canada
Re: Delete after ___ seconds
Fujitsu wrote:I was just wondering whether it was possible to delete a shape after a defined number of seconds/ticks through use of Thyme. If so, how would one implement this?
Yes
- Get a link to the density or airFrictionMult (I have had some problems with simple methods recently, so, perhaps try using advanced linkages).
- Keep your method of linkage (a variable which you can modify, that will modify the attribute of the other object) in mind, and wherever <linkVariable> pops up here, replace it with the name of your variable.
Ticks:
- Code: Select all
Scene.my.Step = 500; // 500 ticks, change this based on how long you want it.
Scene.my.Tick = 0;
Scene.my.ActionArray = [{Scene.my.Tick = Scene.my.Tick + 1},{<linkVariable> = NaN}];
App.numColorsInRainbow = {Scene.my.ActionArray(Scene.my.Tick / Scene.my.Step)();12};
Seconds:
- Code: Select all
<linkVariable> = {Sim.time > 10 ? NaN : 1}; // Replace 10 with the number of seconds after the cumulative time of running this scene in this session that it will delete, and replace 1 with the normal value of your object.
Well, That should do
- gradyfitz
- Posts: 174
- Joined: Tue Sep 01, 2009 8:33 am
- Location: Victoria, Australia
Re: Delete after ___ seconds
Would these codes be applicable to a shape that has been spawned a while into the sim?
May I also ask the significance of changing the amount of coloured rays refracted from a white laser?
May I also ask the significance of changing the amount of coloured rays refracted from a white laser?
-

Fujitsu - Posts: 328
- Joined: Tue Sep 01, 2009 12:28 am
- Location: Canada
Re: Delete after ___ seconds
Fujitsu wrote:Would these codes be applicable to a shape that has been spawned a while into the sim?
Yes, just make sure to add the time from when you started to the number of seconds (only for the seconds method, the ticks method is independent of the simulation).
Fujitsu wrote:May I also ask the significance of changing the amount of coloured rays refracted from a white laser?
You can choose any constantly updated variable, but, I chose App.numColorsInRainbow because I didn't think it would be changed very commonly (if you do modify it, change the number "12" from it into whatever you modified it to
It's not specifically the App.numColorsInRainbow variable that has to be changed this way
Hardly anyone seems to understand this method of timer
- gradyfitz
- Posts: 174
- Joined: Tue Sep 01, 2009 8:33 am
- Location: Victoria, Australia
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests



