March 2019
Intermediate to advanced
708 pages
17h 9m
English
void AChapter_07GameModeBase::BeginPlay(){ Super::BeginPlay(); // Spawn a new actor using the ASingleInterfaceActor class at //the default location FTransform SpawnLocation; ASingleInterfaceActor* SpawnedActor = GetWorld()->SpawnActor<ASingleInterfaceActor>( ASingleInterfaceActor::StaticClass(), SpawnLocation); // Get a reference to the class the actor has UClass* ActorClass = SpawnedActor->GetClass(); // If the class implements the interface, display a message if (ActorClass- >ImplementsInterface(UMyInterface::StaticClass())) { GEngine->AddOnScreenDebugMessage(-1, 10, FColor::Red, TEXT("Spawned actor implements interface!")); ...Read now
Unlock full access