Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Hello! Can someone help me? I want to delete a number of instances of an object.... tried for loop but didn't work...
What are the conditions for removing the objects?
How many objects do you want to delete and why?
Which objects should be deleted, how to know?
I have 100 instances of gas atoms moving in a box... I want to delete random 20 on button click. I give you .capx file
https://www.dropbox.com/s/z5n7yf51k3j8j ... aproj?dl=0
Something like this?
on button clicked
--repeat 20 times
--pick random instance of gass
gass destroy
yep... i tried something like that in .capx file... but it is not working...
Something like that, or exactly that?
For this event should work..
You shared a .caproj and not a .capx, so I can't see..
Sorry... here is the .capx file
https://www.dropbox.com/s/2zcrfdkod5zeu ... .capx?dl=0
<img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":-)" title="Smile">
You should put the conditions in that exactly order, or else it will not work.
Tried this too... but same result..
Can't open the capx, because you are using plugins I don't use, but like I said, the event I posted should work..
https://www.dropbox.com/s/yg3w9j9iy057m ... E.PNG?dl=0
here is a photo of event sheet...
You used the wrong condition. It's pick random instance.
What do you mean? I want to remove 20 random instances. Code says that remove instance 0 every time.. isn't this right?
try this one Test.capx
Develop games in your browser. Powerful, performant & highly capable.
LittleStain try this one Test.capx
Thank you!! this worked fine!!!