L
lexafram
Guest
So i recently got my code to work which spawned an object where i wanted by left clicking but i want to destroy if after a certain period of time, how could i do that?
Thanks a lot for your help
Thanks a lot for your help
I created a timer varIn the create event, you make a "timer" variable, which is equal to 0.
In the step Event of the object, you write :
xx is the time spent before the object gets destroyed.Code:timer += 1; if (timer >= xx) { instance_destroy(); }
i tried what you say and now, it doesn't seem to spawn in the object at all but when i delete the "Don't do "var timer = 0", juste "timer = 0".