[UE4]No owning connection for actor XXX. Function XXX will not be processed
keywords:UE4, Dedicated Server, Replication
Issue
Client execute a server function failed:
LogNet: Warning: UIpNetDriver::ProcesRemoteFunction: No owning connection for actor TopDownCharacter_C_0. Function ServerMoveToDest will not be processed.
Caused by:
Because the Actor which invoking server function on client doesn’t have Connection.
Solution:
How to let object have Connection?
- For
Character
, possess it usingPlayerController
on server after spawning thisActor
on server. AController::Possess(APawn* InPawn) example - For
Actor
, Set an owner which has connection (e.g. aCharacter
that has been possessed byPlayerController
) on server. AActor::SetOwner(AActor* NewOwner) example
Notices for Dedicated Server
- Properties which be flagged as
Replicated
can only be modified on Server, Modifing on client doesn’t take effect. - Clients can only communicate with Server, Clients can’t communicate with each other client directly.
- If Client want to invoke a Server Function, it must be spawned on Server and has the Connection, otherwise invoking would be failed.
最高贵的复仇是宽容。──维克多·雨果(Hugo Victor)