How to spawn C++ subclass blueprint instead of Spawn Base c++ class

I really superised FirstPerson templete spawn ProjectProjectile(Bullet) from bluepring but not ProjectProjectile C++ class one?

I check all blueprint and c++ setting but still don’t find how to do it like that.

Does any one can tell me how to spawn C++ subclass blueprint instead of Spawn Base c++ class

Is this what you are looking for? Spawn a blueprint from c++. I pass the path to the blueprint to the function (path is optained by right clicking on blueprint in editor).

	FVector location = FVector(0.0, 0.0, 0.0);
	FRotator rotation = FRotator(0.0, 0.0, 0.0);

	FActorSpawnParameters SpawnInfo;
	SpawnInfo.Owner = pParentActor;
	SpawnInfo.bDeferConstruction = false;
	UClass* m_BlueprintClass = LoadObject< UClass >(nullptr, *pathToBlueprint);
	AActor* pActor = Cast<AActor>(GetWorld()->SpawnActor<T>(m_BlueprintClass, location, rotation, SpawnInfo));
	if (!pActor ->GetRootComponent())
	{
		pActor ->SetRootComponent(NewObject<USceneComponent>(pActor , TEXT("SceneComponent")));
	}
	pActor->AttachRootComponentToActor(pParentActor);

D

yes, it’s my question I found it yestoday but still thank u for ur help.
I still curious about the “First Person template” because i haven’t found any coding or setting about the ProjectProjectile(bullet) blueprint spawnning by default but the game spawn the BP class instead of the it’s C++ base class. it seems like have a easy way to set the default spawning class is BP or c++