Why does my object spawner stop working after a minute and 40 seconds

This is unrelated to any possible solution, but in the spirit of suggestions…

  • Seems like the switch is intended for weighted selection? You can create a function for that:

  • Could be good to have an array of soft class references assuming the spawned classes have a common parent even if it’s Actor class:

  • IMO the spawned class shouldnt include the spawner. Actors can know when another actor has been destroyed by binding to OnDestroyed:

Then you end up with something that should be easier to iterate upon:

WeightedSpawner

Hope it helps.