UE4使用迭代器按名字寻找Actor实例

引用

#include <EngineUtils.h>

代码

	TActorIterator<TargetClass> It = TActorIterator<TargetClass>(GetWorld());
	for (It; It; It++) {
		if (It) {
			if (It->GetName() == "TargetName") {
				//YourCode
			}
		}
	}