Automatically adding objects to Array when adding to it

Hello,

I’m currently wondering if there is a simple way to automatically add to an array when you add an entry to it?

Right now I am creating a waypoint system. I add a certain blueprint to my scene and then add them to an array on another actor to serve as the waypoints that actor uses. Would there be a way to hit the + button in the array and have it automatically create a new item in the scene and add it to the array?

I don’t know if you means spawn object and put it in array or make array entry and spawn object so i write both:

If you mean spawn object and put it in to array, make object it self place in that array on BeginPlay

If you mean making array entry and spawn object then, thats more diffcult, i think easiest way to do so is to create functions for adding and removing those waypoints and avoid spawning them sepretlly, just using those functions. You could also use structure with coordinates, it can be array of vectors which is also structure, just marked in special way in blueprints. Structures are pure data so they can’t be null, if you make array entry they vector will be fully functional just will have 0,0,0. Problem with this method is that waypoints won’t be visible, you would need to code UI for them to be visible in C++.