Hello, sorry if the question seems obvious, but I couldn’t find it anywhere.
If I define a class either without inheritance, or inherited from one of the many classes which don’t appear in the “New c++ class” creation inside Unreal,
how can I access if from inside the engine? it’s detecting it for sure because it compiles it.
I’m guessing you mean you want to access it within the Blueprint Editor. See the page on Class Declaration, and below are some specific tips:
- You should be inheriting, from
UObject
if nothing else, and use theUCLASS([specifier, specifier, ...])
macro on the line above your class declaration. - If you want to declare variables in Blueprint to hold your object, use the
BlueprintType
specifier. - If you want to subclass your class in Blueprint, use the
Blueprintable
specifier. - Make sure to use
UPROPERTY
specifiers on your object’s fields andUFUNCTION
specifiers on any methods that you want to call from Blueprint.
Thank you very much!
You should be able to UCLASS() every kind of class (U, A, T, F) right?
It can be used on any type of class. The name prefix makes no difference.