Hi there,
I built a spawning trigger system that creates enemies from invisible placeholders/locators when the player collides with a trigger.
When all spawned units of this 'wave' are dead I execute a couple of actions, like opening a door, enable another trigger and such.
But the system creates a noticeable hitch the moment the enemies are created and I don't get why.
On collision with trigger:
pick locators instances tagged with trigger's UID (repeat for each enemy/locator type)
destroy locator
spawn unit (only turret part of the enemy)
store enemy UID in array (to check if wave is defeated)
On enemy created:
container creates missing body object for turret
add obstacle and targets for behaviours
pin turret to base
store parent/child UIDs per object
Can anyone see any inherent issue or performance killer in this so far?
On a side note: going through all instances of an object only concerns the one in the active layout, right?