Description
Associates this actor with a specific net driver by name, moving it out of its current driver's network actor list and into the new driver's list. All subsequent RPCs for this actor will be routed through the specified driver.
Caveats & Gotchas
- • This is an advanced multi-driver networking feature — most projects should never call this. It is intended for games that run multiple net drivers simultaneously (e.g. a voice channel driver alongside the game driver).
- • Calling this on an actor mid-game will cause it to stop replicating on the old driver immediately; any clients that received the actor via the old driver will not automatically receive a destroy message — cleanup is the caller's responsibility.
- • NAME_None and NAME_GameNetDriver are treated as equivalent and route to the default game net driver.
Signature
ENGINE_API void SetNetDriverName(FName NewNetDriverName); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| NewNetDriverName | FName | The name of the net driver to associate with this actor. NAME_None or NAME_GameNetDriver uses the default game net driver. | — |
Return Type
void Example
Move a replicated actor to a secondary net driver C++
// Only in projects with multiple net drivers configured
MyReplicatedActor->SetNetDriverName(FName("SecondaryNetDriver")); See Also
Tags
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?