# OnStartRunning(ref SystemState)

> Called before the first call to OnUpdate and when a system resumes updating after being stopped or disabled.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

## OnStartRunning(SystemState)

```csharp
void OnStartRunning(ref SystemState state)
```

### Parameters

**** (\[SystemState]\(/engine/7000.0/script-reference/unity/entities/systemstate)): The [SystemState](/engine/7000.0/script-reference/unity/entities/systemstate.md) backing this system instance

### Remarks

If the [EntityQuery](/engine/7000.0/script-reference/unity/entities/entityquery.md) objects defined for a system do not match any existing entities then the system skips updates until a successful match is found. Likewise, if you set [SystemState.Enabled](/engine/7000.0/script-reference/unity/entities/systemstate/enabled.md) to false, then the system stops running. In both cases, [ISystemStartStop.OnStopRunning](/engine/7000.0/script-reference/unity/entities/isystemstartstop/onstoprunning.md) is called when a running system stops updating; OnStartRunning is called when it starts updating again.
