Download

What base class do you use for logical objects?

What base class do you use for logical objects?
Some games operate logical objects like ability or quest.
Which class is best for such purposes?

Actor is for objects which has representation on scene.
If I derive from Object with C++, a can’t set it as parent class for blueprints.

I want something like this chain:
UnrealBaseClass <- AbstractBaseCppClass <- ConcreeteBlueprint

AInfo should suit your needs.

I have a quick follow-up question if you don’t mind-how are classes like AInfo instantiated into the world? You can’t use GetWorld()->SpawnActor, but you can’t just treat it like a struct and do something like new AInfo myInfo;, either. Is there a standard paradigm for constructing/destructing data classes?

You can (and you should) use GetWorld()->SpawnActor

Oh you’re right, that does work… I don’t suppose there’s any way to still render your subclass editable within the editor, is there? The reason I’m asking after all of this is because I’m looking for a way to basically use AInfo like a struct that can be pointed to.

I don’t quite understand your question.
If you want to be able to edit your AInfo properties in editor you should make it blueprintable: UCLASS(BlueprintType, Blueprintable).
Make editable the properties you want to be editable: UPROPERTY(EditAnywhere, BlueprintReadWrite).
Then make blueprints that inherit from your base AInfo and edit from blueprints editor. Then spawn instances of the blueprints instead of the C++ class.

Alright, thank you :slight_smile:

Okey, I created c++ class derived from AInfo, it is visible in blueprint editor, but I can’t set it as parent for blueprint classes.
Do I have to add some modificators to UCLASS ?

I just use UObject personally, since AActor is quite a bulky class.

UObject can be made Blueprintable, just use:



UCLASS(Blueprintable)


As I said it is visible from blueprints, the problem is it can’t be parent class.