Networked Transform Component
The plNetworkedTransformComponent replicates a game object's position and rotation across the network with smooth snapshot interpolation. It supports client authority, meaning the owning client drives the transform and broadcasts it to all peers.
Overview
This component is the primary way to synchronize object positions in a multiplayer game. It is suitable for player characters, NPCs, projectiles, or any moving object that does not use rigid body physics.
On the authoritative machine (the owner), the component captures the object's transform each tick and sends it at the configured send rate. On remote machines, incoming snapshots are fed into an adaptive-rate interpolator that produces smooth, jitter-free rendering.
No physics plugin dependency is required. For physics-based objects, use Networked Rigidbody Component instead.
Properties
Property | Type | Default | Description |
|---|---|---|---|
|
|
| How many state updates per second to send (Hz) |
|
|
| Distance threshold above which the object snaps instead of interpolating |
|
|
| Whether to include derived velocity in state updates |
How It Works
Authority Side (Owner)
Each frame,
UpdateAsAuthority()captures the current transform viaCaptureTransformState().At the configured
m_fSendRate, the component writes position, rotation, and velocity into aTransformStatemessage and sends it.In host mode, the state is broadcast to all clients. In client mode, it is sent to the host for relay.
Remote Side (Non-Owner)
Incoming
TransformStatemessages are received viaHandleTransformStateMessage().Each snapshot is pushed into a
plNetworkInterpolatorwith a synthetic timestamp for smooth spacing.Each frame,
UpdateAsRemote()advances the interpolator timeline and callsApplyRemotePosition()andApplyRemoteRotation()to update the game object.
Teleport Detection
If the distance between the current interpolated position and the next target exceeds m_fTeleportThreshold, the component snaps instantly rather than interpolating. This handles respawns, level transitions, or large corrections.
Virtual Hooks
The component provides virtual methods that subclasses can override for custom behavior:
Method | Purpose |
|---|---|
| Called once when authority is resolved. Use to set up cameras, input, first/third person, etc. |
| Called each frame on the owner. Override to inject input or physics before capturing state. |
| Called each frame on remotes. Override for custom interpolation or prediction. |
| Reads the current transform into replicated state fields. Override to add custom state. |
| Applies a received position. Default calls |
| Applies a received rotation. Default calls |
Example: Character Controller Override
Interpolation
The component uses plNetworkInterpolator internally, which provides:
Adaptive-rate playback-- Speeds up or slows down slightly to absorb network jitter.
Zero extrapolation-- Holds the last known position rather than predicting, preventing overshoot.
Configurable delay-- Default 100ms buffer for 20 Hz sends.
See Snapshot Interpolation for details on the interpolation algorithm.
Usage
Add
plNetworkedTransformComponentto any prefab that should have its transform replicated.Spawn the prefab using the Object Manager.
The owning client's transform is automatically replicated to all other machines.