The ForEachUObject function iterates every UObject that currently exists in GUObjectArray.

The GUObjectArray UE4 variable is a large chunked array that contains UObjects.

The structure of this array has changed over the years and the ForEachUObject function is designed to work identically across all engine versions.


1functionCallback to execute for every UObject in GUObjectArray

Callback Parameters

1UObjectThe UObject
2integerThe chunk index of the UObject
3integerThe object index of the UObject


-- Warning: This will take quite a while to finish executing due to all of the 'print' calls
ForEachUObject(function(Object, ChunkIndex, ObjectIndex)
    print(string.format("Chunk: %X | Object: %X | Name: %s\n", ChunkIndex, ObjectIndex, Object:GetFullName()))