MCPcopy Create free account
hub / github.com/URLab-Sim/UnrealRoboticsLab / DestroyActorSync

Function DestroyActorSync

Source/URLabEditor/Private/MjLevelOps.cpp:580–604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578} // namespace
579
580bool DestroyActorSync(const FString& ActorIdOrActorName, FString& OutError)
581{
582 OutError.Empty();
583 if (!GEditor)
584 {
585 OutError = TEXT("GEditor null");
586 return false;
587 }
588 UWorld* World = GEditor->GetEditorWorldContext().World();
589 if (!World)
590 {
591 OutError = TEXT("editor world unavailable");
592 return false;
593 }
594
595 AActor* Found = FindByActorIdOrName(World, ActorIdOrActorName);
596 if (!Found)
597 {
598 OutError = FString::Printf(TEXT("no actor matching '%s'"),
599 *ActorIdOrActorName);
600 return false;
601 }
602 World->DestroyActor(Found);
603 return true;
604}
605
606bool SetActorTransformSync(
607 const FString& ActorIdOrActorName,

Callers 2

HandleDestroyActorFunction · 0.85
RunTestMethod · 0.85

Calls 1

FindByActorIdOrNameFunction · 0.85

Tested by 1

RunTestMethod · 0.68