Files
UEProject/Source/GameIdeaV5_5/MyCustomActorFinder.cpp
2025-11-05 20:09:43 -07:00

20 lines
482 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;
}