How to handle more entities (being cloned)

Hello all,
I am working on a project for science class where there are 3 cubes (green, blue, and pink) and every second (I think) the green and blue cubes clone themselves. (pink cubes clone themselves every 10 seconds. There are also white spheres that kill blue cubes.

While it doesn’t need to have more than 30k entities (my last test crashed playcanvas around that) it would be fun if it could. Also when more entities are cloning there is a massive lag spike. Is there anything that can help with this?

Thanks!

Editor link:https://playcanvas.com/editor/project/1276717

1 Like

So if the clones clone themselves you multiple it exponentially, eg if a box clones once you’d have the same amount forever, double and you need a cap so they don’t multiply forever. Maybe keep track of clones and prevent cloning if there are above a certain amount of clones?

(Sorry if I assumed incorrectly I can’t really view the project since I’m on mobile and my internet isn’t great, if you could explain a bit more I’d like to try and help)