🐾PurrNet Docs
Plug & Play

Network Transform

NetworkTransform is a plug-and-play component that automatically synchronises position, rotation, scale, and parent across all clients. Attach it to any GameObject with a NetworkIdentity.

NetworkTransform — position sync across network
Authority (Owner)
🐱
Actual position
120ms
latency
Remote Client
🐱
Interpolated · ghost = true pos

Setup

Add the NetworkTransform component to a GameObject that already has a NetworkIdentity or NetworkBehaviour. No code required for basic usage.

The component automatically detects authority: if Owner Authis enabled, the owner's position is broadcast to everyone else. If disabled, only the server can push position updates.

Inspector settings

ParameterTypeDefaultDescription
Sync PositionbooltrueSynchronise the transform's world position across all clients.
Sync RotationbooltrueSynchronise the transform's rotation (Quaternion).
Sync ScaleboolfalseSynchronise the transform's local scale. Only enable if scale actually changes at runtime.
Sync ParentboolfalseSynchronise parent changes. Enable for pick-up mechanics or vehicle boarding.
Owner AuthbooltrueWhen true, the owner sends position updates. When false, the server is the sole authority.
InterpolatebooltrueSmooth movement between received snapshots on remote clients. Disable for teleportation.
Send Interval (ticks)int1How many ticks between position broadcasts. Higher = lower bandwidth, choppier movement.
Position Tolerancefloat0.001Minimum position delta before a sync is sent. Prevents micro-updates when standing still.
Rotation Tolerancefloat0.01Minimum angle change (degrees) before a rotation sync is sent.

Interpolation explained

Without interpolation, remote clients "snap" to new positions whenever a packet arrives — creating choppy, teleporting movement. With interpolation enabled, the component smoothly moves the object between the last received position and the newly received one over the expected tick interval, hiding network jitter.

The dashed outline in the visualizer above shows the true authority position. The solid character on the remote side shows the interpolated position — lagging behind but smoothly tracking.

Teleportation (disabling interpolation temporarily)

TeleportSystem.cs
using PurrNet;
using UnityEngine;

public class TeleportSystem : NetworkBehaviour
{
    [SerializeField] private NetworkTransform netTransform;

    // Server teleports the player to a specific position
    [ObserversRpc(runLocally: true)]
    public void RpcTeleport(Vector3 destination)
    {
        // Disable interpolation so the client snaps immediately
        netTransform.interpolate = false;
        transform.position = destination;

        // Re-enable interpolation next frame for smooth subsequent movement
        StartCoroutine(ReenableInterpolation());
    }

    private System.Collections.IEnumerator ReenableInterpolation()
    {
        yield return null;
        netTransform.interpolate = true;
    }
}

Situational example — Vehicle boarding

When a player boards a vehicle, you need to sync both the vehicle position AND reparent the player to the vehicle. Enable Sync Parenton the player's NetworkTransform.

VehicleController.cs
public class VehicleController : NetworkBehaviour
{
    [SerializeField] private Transform driverSeat;
    [SerializeField] private NetworkTransform playerNetTransform;

    [ServerRpc(requireOwnership: false)]
    public void CmdBoard(NetworkIdentity playerIdentity, RPCInfo info = default)
    {
        if (!info.asServer) return;

        // Give vehicle ownership to the boarding player
        GiveOwnership(info.sender);

        // Parent the player to the vehicle seat
        // NetworkTransform with SyncParent=true will sync this reparenting
        playerIdentity.transform.SetParent(driverSeat);
        playerIdentity.transform.localPosition = Vector3.zero;
    }

    [ServerRpc(requireOwnership: true)]
    public void CmdExit(NetworkIdentity playerIdentity)
    {
        playerIdentity.transform.SetParent(null); // detach
        GiveOwnership(null); // remove vehicle owner
    }
}

Don't override transform directly on remote clients

Setting transform.position directly on a non-authority client will be overwritten by the next NetworkTransform sync. Only modify position on the authority (owner or server). Use if (isOwner) or if (isServer) guards.

Bandwidth optimization

Disable sync axes you don't need. A 2D game that never changes scale or Z position wastes bandwidth syncing those values every tick. Use tolerance values to suppress micro-updates when the object is stationary.