Network: How not to send all PRC every tick?

Hello. I have code that moves actors on the client side and every tick I call an RPC on the server so that the server moves the actor for other clients. As far as I know, all RPCs are queued and all will be sent. Accordingly, if the tick is called too often (high FPS), there will be a queue of RPCs between sends. But all RPCs in this queue except the last one are useless (we need the last RPC).

Is there a way to send only the last RPC?

No, Unreal does not automatically discard older queued RPCs and keep only the latest one.
Reliable RPCs are guaranteed and sent in order. Unreliable RPCs may be dropped, but they are still queued for send attempts — Unreal does not treat them as “replace previous with newest”.

Best practice for movement replication:

Do not send an RPC every frame for transform updates.

Instead use one of these approaches:


1. Use built-in movement replication (recommended)

If this is a Pawn/Character, use:

  • CharacterMovementComponent

  • SetReplicateMovement(true)

Unreal already handles client prediction, server correction, smoothing, compression, and update rates efficiently.

This is the proper solution for player-controlled movement.


2. Replicate state, not every Tick event

If this is a custom actor:

Send input/state changes at a fixed rate (for example 10–20 times/sec), not every frame.

Example:

  • Forward value changed

  • Direction changed

  • Target position changed

Then server simulates movement.


3. Use Unreliable RPC + timer

Instead of Tick:

GetWorldTimerManager().SetTimer(..., 0.05f, true);

Send updates every 50 ms (20 Hz).

Use:

UFUNCTION(Server, Unreliable)

This reduces bandwidth heavily.


4. Store latest value and send periodically

If you truly only need the newest update:

  • Client updates a local variable every Tick

  • Every 50ms send one RPC with the latest stored value

Example:

LatestMoveInput = CurrentInput; // every Tick

// timer sends:
Server_SendMove(LatestMoveInput);

This effectively gives you “send only last RPC”.


Important note

If FPS = 120 and net update = 20 Hz, sending Tick RPCs means 6 useless calls between packets. Avoid that design.


Final recommendation

For movement:

  • Characters: use built-in CharacterMovement replication

  • Physics/custom actor: send inputs at fixed rate

  • Never spam Server RPC every Tick unless absolutely necessary


Direct answer to your question

Is there a way to send only the last RPC?