UCLASS(BlueprintType, Blueprintable)
class MYSPACESHIPGAME_API UStarCluster : public UObject
{
GENERATED_BODY()
private:
UPROPERTY(BlueprintReadOnly, Category = "Stars", meta = (AllowPrivateAccess = "true", ExposeOnSpawn = "true"))
FName Name;
UPROPERTY(BlueprintReadOnly, Category = "Stars", meta = (AllowPrivateAccess = "true", ExposeOnSpawn = "true"))
TArray<FStarData> Stars;
...
And I’m constructing it using “Construct Object from Class”.
Is there any method from the UObject interface called after this node finished? I found virtual void PostInitProperties(); but Stars and Name values are not set at this time yet.
Yes, I’m wondering if exists something like OnConstruction or BeginPlay for UObject that is called after the variables referenced on the “Construct Object from Class” node gets assigned. I would like to use them for performing calculations on the object without doing any callback after getting the returned constructed object.
Sadly not. For UObjects you’ve got to either call your own Init type function yourself, or wrap it in some other type of construction call like Widgets do. They are UObjects but have an OnConstruct callback built into how they are created by UMG.