IsValid node not working

­
In 1/10 ViewPort Simulations, I get an Infinite Loop error in this custom event that destroys overlapping rooms when I build the level. Even after executing the IsValid node, I keep getting these two errors from the blueprint:

Blueprint Runtime Error: "Attempted to access BP_Room_C_158 via property K2Node_CustomEvent_LastSpawnRoom, but BP_Room_C_158 is not valid (pending kill or garbage)". Node:  Branch Graph:  ForEachLoop Function:  Execute Ubergraph BP Procedural Dungeon Generator Blueprint:  BP_ProceduralDungeonGenerator
Blueprint Runtime Error: "Accessed None". Node:  Branch Graph:  ForEachLoop Function:  Execute Ubergraph BP Procedural Dungeon Generator Blueprint:  BP_ProceduralDungeonGenerator

This is the only ForEachLoop that has access to the variable LastSpawnRoom:

For some reason, the ForEachLoop keeps accessing the same actor I just destroyed, even though the previous event should have spawned a new actor and set it as the Last Spawn Room.

The game uses random seeds, and only some seeds show this problem.

Try saving the array (Children pin) to a variable and then connecting it to the loop node.

1 Like

is valid (still exists somewhere) → Is pending Kill (in garbage, but not flushed yet)

This got rid of the two invalid actor errors for the LastSpawnRoom variable. Could you explain why this error happens or why this solution works? I want to prevent this kind of error if possible.

Edit: The AccessedNone error is now appearing for a different variable:

I think this is where the new error is happening:

This is because each time the Loop fires for a new index its “Getting” a fresh copy from the Get Children Components node.


Validate Chosen Exit. It’s currently empty/null, thus the error. Go back to the code that sets it. Issue is there.

1 Like