PostInitProperties funcitonality for a USTRUCT

Ben0nator
Tue, 15 May 2018 07:46:33 +0000
Community & Industry Discussion

I’m trying to create a new BlueprintType with a USTRUCT. I expect to be able to do the following:

Make new variable in a blueprint (with my new type)

Set defaults for the new variable (in the blueprint)

The other members of the variable are initialized based on the specified defaults

Obviously I cannot use the PostInitProperties function in a struct since it is defined in UObject.

But if I change my struct to a class derived from UObject, I can’t edit default values in the BP editor:

In other words, how do I remove the need for a custom initialization function? 99.9% of the time, it will be in this exact spot:

Or look at it this way:

In code alone, I’d just use parameters in the constructor to instantiate unique instances of a class/struct. How do I accomplish this with my C++ class when I am instantiating it in UE Blueprints?

I’d like to use it as a variable in Blueprints, so I don’t want to have to create child Blueprint classes of my data class every time I simply need different defaults.

Is something like this possible, a feature request, or against UE4 standards/workflow?

9 posts - 5 participants