This is a weird discussion…
UCLASS(BlueprintType, Blueprintable)
class MYGAME_API APlayingCard : public AActor {
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString MyStringInitInConstructor;
public:
APlayingCard()
{
MyStringInitInConstructor = TEXT("This is string built from C++ constructor.");
}
};
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TSubclassOf<APlayingCard> CardArchetype;
void AMyPlayerController::BeginPlay()
{
if (CardArchetype.Get() && GetWorld())
{
FActorSpawnParameters SpawnParams;
SpawnParams.bDeferConstruction = false;
SpawnParams.Template = CardArchetype->GetDefaultObject<APlayingCard>();
APlayingCard* MyCard =
GetWorld()->SpawnActorAbsolute<APlayingCard>
(
CardArchetype,
this->GetTransformComponent()->GetComponentTransform(),
SpawnParams
);
}
}
I’m not sure I understood the struggle.
That’s the result of a Blueprint created from APlayingCard class, but with its own default values while spawned from C++.
@FatariGames is that what you’re trying to do?!