October 2016
Intermediate to advanced
452 pages
9h 47m
English
This recipe will reuse the GameMode from the previous recipe, so you should complete it first.
GameMode declaration:UPROPERTY() AMyFirstActor* SpawnedActor; UFUNCTION() void DestroyActorFunction();
#include "MyFirstActor.h" to the implementation file's includes.SpawnActor to the new SpawnedActor variable:SpawnedActor = GetWorld()->SpawnActor<AMyFirstActor> (AMyFirstActor::StaticClass(), SpawnLocation);
BeginPlay function:FTimerHandle Timer; GetWorldTimerManager().SetTimer(Timer, this, &AUE4CookbookGameMode::DestroyActorFunction, 10);
DestroyActorFunction:void AUE4CookbookGameMode::DestroyActorFunction() ...
Read now
Unlock full access