Unreal structs initialization

You need to create constructors for the struct as if it was a class and you can fix this.

struct FCharacterAttributes : public FTableRowBase {

	GENERATED_BODY()
// inserted lines
public:   
    FCharacterAttributes( ) { Hair = nullptr; Speed = 0; }
// end of inserted lines

	UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
	USkeletalMesh* Hair;
	
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
	int32 Speed;
}

Note that you can also have more than one constructor.

2 Likes