My situation is as follows:
I have a custom Character class (PWNCharacter extended from ACharacter) and a CharacterStats class (PWNCharacterStats extended from UObject).
CharacterStats is marked as Blueprintable and I’ve created a Blueprint called “PWNCharacterStatsBP”.
I’ve also created a Blueprint of my Character (PWNCharacterBP). The idea is to allow designers to customize a CharacterStats Blueprint and assign it to a character.
To give some more details, In PWNCharacter.h I declare the following:
// Character Stats
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PWNCharacter", meta = (AllowPrivateAccess = "true"))
TSubclassOf<class UPWNCharacterStats> CharacterStatsClass;
protected:
UPROPERTY()
UPWNCharacterStats* CharacterStats;
And in PWNCharacter.cpp I create an instance of PWNCharacterStats class as follows:
// Sets default values
APWNCharacter::APWNCharacter()
{
// Other stuff above
// Stats - Provide a default value for the class to spawn
CharacterStatsClass = UPWNCharacterStats::StaticClass();
}
void APWNCharacter::OnConstruction(const FTransform & Transform)
{
Super::OnConstruction(Transform);
// Spawn CharacterStats
CharacterStats = NewObject<UPWNCharacterStats>(this, CharacterStatsClass, TEXT("CharacterStats"));
}
So now in the Editor, on my PWNCharacterBP I assign the PWNCharacterStatsBP to the CharacterStatsClass variable, and as soon as I do that the engine crashes with the following:
Objects have the same fully qualified name but different paths.
New Object: PWNCharacterStatsBP_C /Engine/Transient.World_3:PersistentLevel.PWNCharacterBP_C_1.CharacterStats
Existing Object: PWNCharacterStats /Engine/Transient.World_3:PersistentLevel.PWNCharacterBP_C_1.CharacterStats
Any ideas what’s happening here? I’ve already tried:
- Deleting Intermediate folder and regenerating VS files
- Moving the Blueprints to different folders
- Deleting the Blueprints and recreating them