Files
UEProject/Source/ThisWillWork/MyCustomActorFinder.cpp
2026-02-01 20:19:37 -07:00

23 lines
485 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#include "MyCustomActorFinder.h"
#include "Engine/World.h"
#include "GameFramework/Actor.h"
#include "EngineUtils.h"
AActor* AMyCustomActorFinder::FindActorByName(const FString& ActorName)
{
for (TActorIterator<AActor> It(GetWorld()); It; ++It)
{
AActor* Actor = *It;
if (Actor->GetName() == ActorName)
{
return Actor;
}
}
return nullptr;
}