UGameplayStatics::GetAllActorsOfClass(GetWorld(), AStaticMeshActor::StaticClass(), OutActors);for(AActor* actor : OutActors) { UKismetSystemLibrary::PrintString(GetWorld(), actor->GetName()); } UKismetSystemLibrary::GetAllActorsWithTag Syntax staticvoidGetAllActorsWithTag(constUObject* World...
FName OtherActorTag; void FindOtherActor() { AMyActor* FoundActor = nullptr; UGameplayStatics::GetAllActorsWithTag(GetWorld(), OtherActorTag, FoundActor); if (FoundActor != nullptr) { 找到了相关的Actor 进行进一步操作 } } }; 在这个示例代码中,我们使用了GetAllActorsWithTag函数来查找具有特定...
Get All ActorWith Tag 获取所有的带有tag的Actors SetInputUIOnly 设置输入方式只有UI SetInputModeGameOnly 设置输入方式只有游戏 SetGamePause 暂停游戏 QuitGame 退出游戏 SetTimerByFunctionName 设置定时器 ClearTimerByFunctionName 清除定时器 Actor Has Tag 检查Actor是否有tag标签 IsKeyDown 检查某个键是否按下...
[UE4]获得特定类型的所有Actor:Get All Actors Of Class、Get All Actors with Interface、Get All Actors with Tag 本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
运行游戏可以看到,按下W键,打印出了发信方的坐标。数据通了。 案例完毕。 案例延展 我们还可以通过“谁有接口发信给谁”的方式。使用get all actors with interface,如下图1-12。 图1-12 要是再结合碰撞检测,距离判断,数值判断,tag判断,进行进一步的筛选,让消息发送准确无误,就更有意思了。
1.GetActorArrayAverageLocation 作用:获取Actor数组的平均位置 2.GetActorArrayBounds 作用:获取Actor数组的边界 (4)获取Actor相关 GetAllActorsOfClass 获取此类的Actor数组 GetAllActorsWithInterface 获取拥有此接口的Actor数组 GetAllActorsWithTag 获取此Tag的Actor数组 ...
先通过 Tag 获取到场景中的 Actor 对象: TArray<AActor*> actors; UWorld* world = GWorld->GetWorld(); UGameplayStatics::GetAllActorsWithTag(world, ActorTag, actors); AActor* actor = actors[0]; 通过FindFieldChecked 获取 FProperty:
TArray<AActor*> OutActors;UGameplayStatics::GetAllActorsOfClass(GetWorld(), AStaticMeshActor::StaticClass(), OutActors);for (AActor* actor : OutActors){ UKismetSystemLibrary::PrintString(GetWorld(), actor->GetName());} UKismetSystemLibrary::GetAllActorsWithTag Syntax static void GetAll...
UE4蓝图节点1.0.doc,1 Set Visibility 12 (一) 静态网格物体隐藏节点 12 (二) 粒子隐藏节点 12 2 DestroyActor 13 (一) 销毁节点 13 3 Delay 13 (一) 延迟节点 13 4 SpawnActor Kai Shi 13 (一) 生成Actor类到场景里面 13 5 Get All Actors Of Class 14 (一
This is useful for references to other objects and actors who's value isn't known until run-time. This prevents the editor from ever saving a reference to it, and speeds up saving and loading of the blueprint class.Because of this, all transient variables should always be initialized as ...