Did we discuss the ::StaticClass() prior to this lesson?

Hi I am confused about the ::StaticClass() function that we used as part of the GetAllActorsOfClass. I do not remember this being introduced or discussed prior to this lesson? And was a very cursory one at that. If we did discuss this prior as to what is and why we would use it here. Please could someone let me know which lesson it was in.

Many thanks :slight_smile:

It is essentially to pass the type as a function argument.

StaticClass() returns a UClass* that represents that type.
UClass is part of Unrreal’s reflection system and it contains information about the type which is how that function will filter for objects for that type.

Useful links:

1 Like

Thanks as every Dan :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms