I have attached various actors to another single actor in my level by drag & drop in the outliner, but I wish to detect when this event occurs.
From such an event I could then add/remove elements in, or just repopulate a, TArray list I have as part of my actor for which I attaching these actors.
For example, I add BP_Enemy to the scene, then in the outliner I drag & drop it onto one of my BP_Container actors which already exists in my level.
In my BeginPlay I copy each element from this list into a static array for performance and performing various tasks.
My current implentation has me:
- add a BP_Enemy to the level
- drag & drop onto my specific BP_Container in the outliner,
- after selecting that specific BP_Container I fill in the list’s element for the class of my BP_Enemy.
Not only is this annoying and time consuming, but if I delete a BP_Enemy actor from my level, the element containing a pointer to that actor is not automatically set back to being nullptr; which could lead to a crash if I make this mistake during my game’s development.
Any help on this at all is apprecaited. Perhaps any proposed solutions could help others too.