October 2016
Intermediate to advanced
452 pages
9h 47m
English
Scene Components are a subclass of Actor Components that have a transform, that is, a relative location, rotation, and scale. Just like Actor Components, Scene Components aren't rendered themselves, but can use their transform for various things, such as spawning other objects at a fixed offset from an Actor.
SceneComponent called ActorSpawnerComponent. Make the following changes to the header:UFUNCTION() void Spawn(); UPROPERTY() TSubclassOf<AActor> ActorToSpawn;
void UActorSpawnerComponent::Spawn() { UWorld* TheWorld = GetWorld(); if (TheWorld != nullptr) { FTransform ComponentTransform(this->GetComponentTransform()); TheWorld->SpawnActor(ActorToSpawn,&ComponentTransform); ...Read now
Unlock full access