I have a system that spawns from a pool, a bunch of prefabs. On each of them I have a FSM template that makes them move after they have received an event. After a second or so, the first prefab is despawned and a new one is spawned, and so it continues.
Since I want to move the prefabs at a specific timing I use send event to gameobject/children, to the parent of the spawned prefabs. I do this every frame and there are about 25 objects at any time.
This causes extreme frame spikes every few seconds from garbage collection. I've checked in the logs that the event sends to the correct objects and they do. Also, if I disable the action, the spikes disappear.
Is this normal and what can I do about it? I must have a way to trigger the FSM's after other things has happened first.