Please note: development of Photon TrueSync & Thunder is ceased and we will not publish any further updates. While existings apps are not affected, we recommend to migrate apps that are still in development.

TrueSync Manager

A TrueSync-managed Session

Photon TrueSync is a multiplayer lockstep system, so all game code must be executed in discrete steps (we call them ticks) that are run in the same order in all client computers in the gameplay room.

To guarantee that the simulation will give the same result in all clients, this discrete simulation is controlled by a component named TrueSyncManager that must be present in the Unity scene that will host gameplay code and game objects.

To start a TrueSync managed lockstep session, just load a scene that contains a TrueSyncManager component attached to a game object.

If the scene is loaded while the client machine is connected and inside a Photon room, TrueSync will run in online lockstep with all clients in the same room. If not connected to Photon, TrueSync will run in offline mode, which is great for single player portions of the game, code for online and offline gameplay can easily be reused.

The TrueSyncManager Component

The Figure bellow shows a TrueSyncManager component in a game object inspector:

// image tsmngr

Player Prefabs

The collection Player Prefabs simplify the instantiation of player-controlled game objects.

// image player prefab

A Player Prefab is a normal Unity prefab, that will have an instance created by TrueSync for each player in the lockstep session (the Photon room).

For each player, there will be a copy of its player prefabs in each of the computers connected to the Photon room.

Player prefabs normally contain at least one TrueSyncBehaviour attached to them.

Back to top