What does Interpolation Target do in NetworkTransform component?

Options

I wanted to know what would be the difference on Remote gameobjects networked movement when I give a Transform reference to the Interpolation Target in Network Transform component, since i'm keeping it empty so far and it's working fine.

Comments

  • ramonmelo
    Options

    Hi @Siddhant ,


    The "Interpolation Target" is a Transform object used for smooth view interpolation between state updates.

    It is mainly useful if you use a low update rate and to hide gaps in the updates in a high lag situation, for example.


    --

    Ramon Melo

    Photon Fusion Team

  • emotitron
    emotitron ✭✭✭
    Options

    The main purpose of Interpolation Target is to separate the tick based simulation states from what is presented to the user (lerped/interpolated views). In the case of NetworkRigidbody for example this is critical because you do not want to manipulate the transform of the Rigidbody directly to interpolate it, as this would dirty the transform and it would affect the Physics.Simulate() call in the next simulation cycle.

    Normally in Unity this is a non-issue because Rigidbody interpolation is automatic and Unity hides that it is doing this. When manually simulating PhysX (which is necessary in Fusion for prediction) Unity does not interpolate Rigidbodies, and this separation of state and presentation becomes necessary - as Fusion now has to manage interpolation.

    Interpolation Target is what gets interpolated in LateUpdate() and should contain no physics objects. It gives you specific control over what is considered "cosmetic", and it should not contain anything that represents state (like colliders).