diff --git a/Source/VocationLife/Private/VocationTestWorldBuilder.cpp b/Source/VocationLife/Private/VocationTestWorldBuilder.cpp index f83a112..16a4895 100644 --- a/Source/VocationLife/Private/VocationTestWorldBuilder.cpp +++ b/Source/VocationLife/Private/VocationTestWorldBuilder.cpp @@ -12,7 +12,6 @@ #include "Components/SkyLightComponent.h" #include "EngineUtils.h" #include "Kismet/GameplayStatics.h" -#include "UObject/ConstructorHelpers.h" AVocationTestWorldBuilder::AVocationTestWorldBuilder() { @@ -36,15 +35,15 @@ void AVocationTestWorldBuilder::BuildTestWorld() return; } - static ConstructorHelpers::FObjectFinder PlaneMesh(TEXT("/Engine/BasicShapes/Plane.Plane")); - if (PlaneMesh.Succeeded()) + UStaticMesh* PlaneMesh = LoadObject(nullptr, TEXT("/Engine/BasicShapes/Plane.Plane")); + if (PlaneMesh) { FActorSpawnParameters SpawnParams; SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; if (AStaticMeshActor* Floor = World->SpawnActor(FVector::ZeroVector, FRotator::ZeroRotator, SpawnParams)) { - Floor->GetStaticMeshComponent()->SetStaticMesh(PlaneMesh.Object); + Floor->GetStaticMeshComponent()->SetStaticMesh(PlaneMesh); Floor->SetActorScale3D(FVector(20.f, 20.f, 1.f)); } }