So i’m currently creating some spotlights and then adding them in the spotlight spawners hierarchy as well as a array on the spotlight spawner.
But the issue i’m currently having is that i cannot set the rotation or the location of the created spotlights. I want to be able to move the spotlights around in the world but i’m currently unable to do so.
Here is my code.
void ALightOrigin::BeginPlay()
{
Super::BeginPlay();
ASpotLight* SpotLightTemp;
SpotLightTemp = GWorld->SpawnActor<ASpotLight>(ASpotLight::StaticClass());
SpotLightTemp->SetBrightness(Brightness);
SpotLightTemp->AttachRootComponentToActor(this);
SpotLights.Add(SpotLightTemp);
SpotLights[0]->SetActorRelativeLocation(FVector(50.0f, 0.0f, 0.0f));
SpotLights[0]->SetActorLocation(FVector(150.0f, 0.0f, 0.0f));
SpotLights[0]->SetActorRotation(GetActorRotation());
}
Neither of the set actor rotation/location seems to work for me.
Am i doing something wrong here?