I want to create a custom class in C++. This class should have Properties / Functions which is different for every instance.
In a Blueprint I want to create a variable of this class. This is working, I can work with Properties / Functions aso.
But I will use this type very often, I don’t want to call “Construct My Object”, setting the variables by hand aso. In pure C++/Java I would use a Constructor.
Sure I could create a Blueprint Library with a factory for this, but this is a workaround in my opinion.
Here is an example class:
The details look like this:
And should look like this:
As UClass specifier I tried variations of Blueprintable,BlueprintType,EditInlineNew,DefaultToInstanced. I think BlueprintType,EditInlineNew is needed.
As UProperty specifier I tried variations of Blueprint…,Edit…,NoClear,SimpleDisplay,Visible…. Because I like variables which are only set in constructor, in Blueprint I would tick “Instance Editable”,“Blueprint Read Only”, “Expose on Spawn”, "Private"I think this is correct: BlueprintReadOnly,EditInstanceOnly
None of the attempts worked, what do I need for it?
Iam new to C++ / UE4 so maybe I missed some keywords, feel free to point me to them.
Links:
-
[Class Specifiers][4]
-
[Property Specifiers][5]