Spawn Object Node - Number of spawned objects increases exponentially

Hi there, I noticed a strange behaviour of the Spawn Object - Node. Here is my setup.

On pressing “a” it spawns the cube-object at a random location, that it takes from the spheres array. I want to spawn in one cube at a time at a random location but this works only with the first time I press “a”, for on every subsequent time I press “a” it keeps increasing the number of spawns exponentially, that is 1 - 2 - 4 - 8 - 16 … cubes are beeing spawned. Is this behaviour of the Spawn Object-Node intentional? How do I limit the number of spawned cubes in my setup to one?

Hi,

please read https://github.com/armory3d/armory/wiki/Common-Mistakes#dont-put-a-trait-that-spawns-an-object-on-the-spawned-objects or alternatively Spawning Objects makes Armory3D game Lag, it’s probably caused by the fact that the above logic tree is part of the spawned cube itself.

2 Likes

… more cubes than atoms in the univers … I get it. Thanks for your quick reply and showing me a way to solve the problem.

3 Likes