Whenever I attempt to spawn blueprint object c++ it fails. UBasicUnit, is a blueprint actor with the parent class being Ar1_CPPtoBPCharacterTransition which is a c++ class. The place I’m trying to spawn it out of is a blueprint class that has a parent of AArchwaySpawn. Whenever this function is called, the editor crashes and I can’t figure out why.
AArchwaySpawn.h file
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Ai To Spawn")
TSubclassOf<Ar1_CPPtoBPCharacterTransition> uBasicUnit;
AArchwaySpawn.cpp file
FActorSpawnParameters SpawnParams;
if (AiToSpawn == EAiToSpawn::BasicUnit) {
GetWorld()->SpawnActor<Ar1_CPPtoBPCharacterTransition>(uBasicUnit, GetActorLocation(), GetActorRotation(), SpawnParams);
}