# 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*.

```csharp
Application.targetFrameRate = 10;
```

{% hint style="info" %}
**coherence** will automatically limit the target framerate of uploaded simulators to **30 frames per second**. We plan to enable lifting this restriction in the future. Check back for updates in the next couple of releases.
{% endhint %}

### 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.

```csharp
var entity = coherenceSync.LinkedEntity;

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

{% hint style="info" %}
In the future, you will be able to define entity simulation frequencies in the schema as well.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coherence.io/0.5.2/optimization/simulation-frequency.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
