RealDocs

AActor::GetNetDriverName

function Engine Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: const

Description

Returns the name of the net driver associated with this actor. All RPCs sent by this actor travel over the connection belonging to this named driver.

Caveats & Gotchas

  • Most actors use the default net driver (NAME_GameNetDriver). You only need to inspect this if you are running multiple net drivers simultaneously, such as a separate voice or demo driver.
  • Changing the net driver mid-play via SetNetDriverName() removes the actor from the old driver's actor list and inserts it into the new one — connections established before the switch are not migrated automatically.

Signature

FName GetNetDriverName() const { return NetDriverName; }

Return Type

FName

Example

Check if actor uses the default net driver C++
if (MyActor->GetNetDriverName() == NAME_GameNetDriver)
{
    UE_LOG(LogNet, Log, TEXT("Actor uses default net driver"));
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.