Simulation frequency

If we don't do any special configuration, entity data is captured at the highest possible frequency and sent to the replication server. This often generates more data than is needed to efficiently replicate the entity's state across the network.

Global simulator frequency

On a simulator, we can limit the framerate globally using Unity's built-in static variable targetFrameRate.

Application.targetFrameRate = 10;

Per-component frequency limitation

Components can have their own maximum simulation framerates. These can be defined at runtime by adding a Set[ComponentName]Frequency component to the entity.

var entity = coherenceSync.LinkedEntity;

if(entity != Entity.Null)
{
    EntityManager.AddComponentData(entity, 
        new SetWorldPositionFrequency 
        { 
            samplingFrequency = 3.0f 
        }
    );
}

Last updated

Was this helpful?