I’m working on an ability to select multiple walls in a scene and change their colour. When I select the walls with a Line Trace By Channel, I spawn a paint brush blueprint actor in front of each wall to indicate which wall is selected. I add some of the out hits from the trace, and this paint brush blueprint to a structure array.
Once I’ve confirmed the colour change I then use Destroy Actor to remove the paint brush blueprint actors from the array and then ‘Clear’ my arrays.
This works, but then if I go to select the walls again, the paint brush actor does not re-spawn, and the arrays must be messed up as I can’t then change the colour of any of the walls.
From trying to research what could be the problem, it’s probably because I’m looping through the array to destroy actors, which is then messing up the array somehow. But even when I just ‘Clear’ the array without looping through it or destroying actors, it still messes up the array as none of the other selection functionality works and I can’t change the colour of the walls.
Any help would be appreciated!