Accessed None Error When trying to find actor location from array

So ive been trying to create a respawn system in my multiplayer game where i have an actor class called respawn and place it around the level. I then find the location of all the respawn classes and randomly spawn at one of them, but when i seem to trigger the event I get an accessed none error. So far i have figured out that the array is not being filled when I am loading into the level from my main menu. Does anyone have any idea how I could fill the array when I load into the level.

Is that the only place you are calling the FindRespawnLocation function? If not, where else are you calling it?

Your array won’t fill up with there no “Reswpan” object on the level simple as that, so you need to somehow place them before this code is executed, or make your code check if array is empty and return some default vector in such case

Its the only place where I call the function

The respawn objects are placed in the level that i load into but it doesn’t fill the array for some reason.