AActor const*const actor = HitResult->GetActor();
if (actor && actor->GetName() == “EditorCube”)
{
HitResult->GetActor()->Destroy();
}
Is this what you’re trying to do? Or are you trying to destroy the UStaticMeshComponent associated with the actor named “EditorCube”?