How do I cap the amount of targets that can spawn?

Some suggestions:

  • If they are going to keep spawning after destroyed, then rather than destroying / spawning, have that actor move to a random location.
  • On the actor that is managing the system (the spawner), rather than getting all actors of class bind the target OnDestroy event so that it knows when a target has been destroyed. It can then move it or spawn a new one.
  • I see there is an array for target class: if the difference is color or the static mesh comp, then perhaps only a single class is needed and the logic to randomize can be on the begin play of the actor?