# SetPlayerLoop(PlayerLoopSystem)

> Set a new custom update order for all engine systems in Unity.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.LowLevel](/engine/6000.6/script-reference/unityengine/lowlevel.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static void SetPlayerLoop(PlayerLoopSystem loop)
```

### Parameters

**** (\[PlayerLoopSystem]\(/engine/6000.6/script-reference/unityengine/lowlevel/playerloopsystem)):&#x20;

### Remarks

Use `SetPlayerLoop` to specify a custom update order for the Player loop. The [PlayerLoopSystem](/engine/6000.6/script-reference/unityengine/lowlevel/playerloopsystem.md) supplied as the `loop` parameter becomes the new current Player loop returned by [PlayerLoop.GetCurrentPlayerLoop](/engine/6000.6/script-reference/unityengine/lowlevel/playerloop/getcurrentplayerloop.md). The new update order does not take effect until the next full Player loop iteration, but the changes are immediately visible in subsequent calls to [PlayerLoop.GetCurrentPlayerLoop](/engine/6000.6/script-reference/unityengine/lowlevel/playerloop/getcurrentplayerloop.md).

Only systems included in the new Player loop will run. You can insert custom script entry points in the update order before setting it. For example, this allows you to add a script that runs immediately before physics, or in other places where scripts are not run by default.

The following example inserts a custom Player loop system that runs after the `PreLateUpdate` system in the Player loop. The custom system's `updateDelegate` is assigned the `CustomUpdate` method, which prints a message to the console when it runs.

Additional Resources: [PlayerLoopSystem](/engine/6000.6/script-reference/unityengine/lowlevel/playerloopsystem.md).

### Examples

```csharp
{code Documentation/ManualDocs/com.unity.documentation-examples/CoreProgramming/Scripts/PlayerLoop/PlayerLoopSetPlayerLoop.cs#example}
```
