hi guys why is these actors named actor not thier name they are static meshes and why the world outliner refuse to take me to thier location and instead it take me to the bluepint location unless i click on them here is my code
if (SpawnInfo.PlaneMesh) // Assuming the train is at index 0
{
float RandomChance = FMath::RandRange(0.0f, 1.0f);
if (RandomChance <= SpawnInfo.PlaneSpawnProbability)
{
// Spawn an empty actor to attach the component to
FActorSpawnParameters SpawnParams;
FString UniqueName = FString::Printf(TEXT(“PlaneActor_%d_%s”), ObstacleIndex, *FDateTime::Now().ToString(TEXT(“%Y%m%d%H%M%S%f”)));
SpawnParams.Name = FName(UniqueName);
AActor NewPlaneActor = GetWorld()->SpawnActor(AActor::StaticClass(), SpawnPosition, SpawnInfo.PlaneRotation, SpawnParams);
// Create the static mesh component and attach it to the new actor
UStaticMeshComponent* PlaneComponent = NewObject<UStaticMeshComponent>(NewPlaneActor, UStaticMeshComponent::StaticClass());
PlaneComponent->SetStaticMesh(SpawnInfo.PlaneMesh);
PlaneComponent->SetWorldLocation(SpawnPosition + SpawnInfo.PlaneLocationOffset);
PlaneComponent->SetWorldRotation(SpawnInfo.PlaneRotation);
PlaneComponent->SetWorldScale3D(SpawnInfo.PlaneScale);
PlaneComponent->RegisterComponent();
PlaneComponent->AttachToComponent(NewPlaneActor->GetRootComponent(), FAttachmentTransformRules::KeepWorldTransform);
// Add the new actor with the attached plane component to the array of spawned actors
SpawnedActors.Add(NewPlaneActor);
}
}