Yea, I am not surprised, connect your Spawn Pug event to the clear array not the spawn node and it should work.
But! You also need to remove the target point from the array after the pug died otherwise the location would never free up, and you could only use it once in the whole game, which is not what you want.
Go to your Pug blueprint and create a Target Point actor (not array this time) and name it âOccupiedTargetâ and check the âEditableâ and âExpose on Spawnâ checkboxes. This variable will hold the occupied target of your pug, so you will know this way which target point location to free up when the pug dies. The âEditableâ and âExpose on Spawnâ checkboxes make that variable exposed, so when you spaw your pug, you will see an input option called âOccupiedTargetâ in the âSpawnActorFromClassâ node. You want to plug the array element you get from the âFreeTargetsâ array (the same blue wire that you used for the âGetActorTransformâ) to that input.
Only now I noticed that you created this spawner in the Level Blueprint, which is not so optimal, because communicating between class blueprints and the level blueprint is not obvious (you need to use Event Dispatchers in order to talk to the Level Blueprint from a class blueprint, which is a whole new topic), so what I would suggest you to do is grab and copy this whole âspawning setupâ and move it form the Level Blueprint to a blueprint class (just create a new Actor Bluerpint Class, name it spawner and place it into your level from the content browser by drag and dropping it).
To move this from the level blueprint is important because you want to tell your spawner from a class blueprint(pug) to remove a certain element from one of its arrays, so you need a reference, but it is not that simple with level blueprints. Once you moved it to a class blueprint, create another âEditableâ/âExposed on Spawnâ variable on your pug blueprint named âSpawnerReferenceâ and the type is whatever name you gave to your new ActorBlueprint (so if you named it âPugSpawnerâ you would chose a âPugSpawner Referenceâ variable type). Make sure to plug a âSelfâ reference of your PugSpawner in that input when you spawn your pug.
The last step, is to go to your Pug blueprint again, and create a function called âKillPugâ. You want to call this function when the movement timeline finishes (so not the Destroy Actor). In this function you need to grab your âPugSpawnerâ reference variable from the left tab (the one that you exposed and filled up with the PugSpawner reference) and you want to âgetâ it. Grab a wire from it and start to type in âTakenTargetsâ and you should see an option to choose âGet TakenTargetsâ (you might need to switch off context sensitivity). Now grab your âOccupiedTargetâ reference, âgetâ it and remove that element from the âTakenTargetsâ using the âRemoveâ node. After this, you can call âDestroyActorâ and now the space should be free again fo other pugs to spawn.
I hope it helps, if you still struggle I will try and illustrate it with a few screenshots.