Download

SetActorLocation reacting badly to an array Get?

Hey guys, I’m trying to set up a system were a bunch of rooms get moved into places at random upon loading the level. Unfortunately there seems to be some kind of problem between my SetActorLocation and the Get that is connected to the Get All Actors of Class. It works fine however occasionally it seems to fail at random intervals and gives me the following message;

Error Blueprint Runtime Error: Accessed None trying to read property CallFunc_Array_Get_Item2 from function: ‘ExecuteUbergraph_RoomSpawner2’ from node: SetActorLocation in graph: EventGraph in object: RoomSpawner2 with description: Accessed None trying to read property CallFunc_Array_Get_Item2

The idea of the code is that on multiple locations marked by static meshes the blueprint will pick a random number based on how many rooms are loaded into the map, which are all Room Parent’s children. It then gets checked against a list to see if it has already been called, if it has it goes back around to pick a different number and if it hasn’t it gets moved to the location. At the end the Number Chosen gets added to the array of already called numbers.

Any advice on how to fix or work around this probably happening is very appreciated.