Download

What is the c++ equivalent to BP's Class Reference?

I am converting BP to C++ and the variable in question is a Class Reference;

What is the C++ equivalent?

TSubclassOf Type* -> StaticClass() Type*

I know I am overthinking this.

Screen Shot 2020-05-29 at 8.35.42 AM.png

Isthiswhat you’re looking for? So if for example, I wanted it for APawn, it would be APawn::StaticClass()

TSubclassOf<> is (as the name implies) for sub-classes. Typically you would use this to reference Blueprint assets, or pass classes around the codebase. It can be nicely exposed through reflection.

SomeType::StaticClass() is useful when you just want to reference the native class.