Hello again.
During a PIE session the initial object described by a blueprint is loaded and made available:
Then for spawning the following steps are taken:
I'm not sure what I'm doing wrong, or incorrectly, but it seems that this will only work the first time. What changes need to be made in order to have it work reliably? That is, always spawn each time the session is started.
For the record, this was modeled from the following link: https://wiki.unrealengine.com/TAsset..._Asset_Loading
Any help you can provide is appreciated.
Thank you.
During a PIE session the initial object described by a blueprint is loaded and made available:
Code:
.h TAssetSubclassOf<AMyPawn> myPawnTemplate; .cpp void APawnManager::BeginPlay() { : gameInstance->AssetLoader.SimpleAsyncLoad(myPawnTemplate.ToStringReference()); : }
Then for spawning the following steps are taken:
Code:
void APawnManager::Tick(float DeltaSeconds) { : if (myPawnTemplate.IsValid()) { AMyPawn* pawn = GetWorld()->SpawnActor<AMyPawn>(myPawnTemplate.Get(), spawnLocation, spawnRotation); } : }
For the record, this was modeled from the following link: https://wiki.unrealengine.com/TAsset..._Asset_Loading
Any help you can provide is appreciated.
Thank you.
Comment