Last updated: November 2026. Parts 1 to 5 of 6 published. Built with Photon Quantum 3.1 and Unity 6.3 LTS (URP).
How do you build an online multiplayer game in Unity with Photon Quantum? Simple Brawler answers that with a working example. Across six videos, we build a small party brawler from an empty Unity project: players spawn, move, jump, charge a dash attack and knock each other and physics props off a platform. Photon Quantum runs the whole game as a deterministic simulation. Every client runs the same simulation from the same player inputs, so movement, physics and knockback stay in sync without any per-object synchronization code in the project.
Each part has a video, a written step-by-step guide on doc.photonengine.com, and from Part 4 on a downloadable sample project. This page collects all of them, explains what each part teaches, and is updated as new parts are released.
Game state, lives and death cycle, a rotating obstacle (coming next)
–
–
–
Before you start
The series uses Photon Quantum 3.1 and Unity 6.3 LTS with the Universal Render Pipeline. Quantum 3.1 was in preview when the videos were recorded, so your SDK build number may differ. The APIs used in the series are stable across releases. Part 2 also adds the Cinemachine package from the Unity Registry.
You should know Unity and C#. You don’t need prior networking experience, but it helps to know what Photon Quantum is and how deterministic predict/rollback works. If that’s new, start with the Quantum beginner guide.
You need a free Photon account and an App Id from the Photon Dashboard. Part 1 shows how to create one.
Why this game uses Photon Quantum
A physics brawler is a good fit for Photon Quantum. Knockback, collisions and props flying off a platform have to look the same for every player, and players notice immediately when they don’t. Quantum sends only player inputs over the network and runs an identical deterministic simulation on every client. Each client predicts ahead and rolls back to resimulate when confirmed inputs differ, which keeps the game responsive on higher-latency connections. Predict/rollback reduces perceived input latency; it doesn’t remove network latency.
The trade-off is that gameplay code has to follow deterministic rules. The series shows them as they come up: fixed-point math (FP, FPVector3) instead of float, Quantum’s RNG session instead of UnityEngine.Random, and systems that hold no state of their own.
Photon Quantum isn’t the right choice for every project. It is Unity-only today, so Unreal and Godot projects should look at Photon Fusion. Teams that want to keep ordinary Unity gameplay code without deterministic constraints will also find Photon Fusion closer to their normal workflow. And because every client runs the full simulation, every client knows the full game state, which matters for genres where hidden information is part of the game.
Part 1: Setting up Quantum and moving your first character
Question it answers: How do I set up Photon Quantum in a Unity project and get a character moving in an online session?
Part 1 goes from a blank Unity 6 project to a character that moves and jumps in an online session between the Unity editor and a standalone build. You download the Quantum 3.1 SDK, create an App Id, and let the Quantum Hub configure the project.
The core of the video is Quantum’s ECS. Entities are IDs, components hold data, systems change that data, and signals let systems react to events. You declare a PlayerLink component in a .qtn file, and Quantum’s code generation writes the C# struct. A PlayerJoinedSystem reacts to ISignalOnPlayerAdded and spawns the avatar each player brings with them:
csharp
public void OnPlayerAdded(Frame frame, PlayerRef player, bool firstTime)
{
var entityPrototype = frame.GetPlayerData(player).PlayerAvatar;
var entity = frame.Create(entityPrototype);
frame.Add(entity, new PlayerLink() { Player = player });
}
Input is declared in the same QTN file with fixed-point types (FPVector2 Movement; button Jump;), read from Unity’s Input System and passed to the simulation. A PlayerMovementSystem applies force and a jump impulse to every entity with PlayerLink and PhysicsBody3D. Swapping the local debug runner for Quantum’s Start UI then puts the editor and a standalone build into the same online session.
Things that catch people in this part: Unity’s Vector2 and Vector3 never enter the simulation, because floats can differ across hardware. Components are structs, so you change them through frame.Unsafe.GetPointer<T>. A system that isn’t registered in QuantumDefaultConfig compiles but never runs. And Quantum starts in spectator mode, so the Local Players array on QuantumLocalDebugRunner needs at least one entry.
Part 2: Camera follow, animation and Data Assets
Question it answers: How do the Quantum simulation and the Unity view talk to each other?
In Quantum, the simulation and the Unity view are separate. A player’s GameObject is a view of a simulation entity, so you can’t parent a Cinemachine camera to it the way you would in a single-player project. Part 2 uses Quantum’s Entity View Context instead: a CameraViewContext implementing IQuantumViewContext holds the camera reference and sits on the same GameObject as QuantumEntityViewUpdater. A view component then sets the follow target for the local player only:
csharp
public override void OnActivate(Frame frame)
{
var link = frame.Get<PlayerLink>(EntityRef);
if (!Game.PlayerIsLocal(link.Player)) return;
ViewContext.Camera.Follow = transform;
}
Animation follows the same rule. A view component reads PhysicsBody3D velocity from the simulation in OnUpdateView and drives the Animator. It checks first that the entity still exists, because a destroyed entity’s view can stay in the scene for a moment. Turning toward the movement direction happens in the simulation with FPQuaternion.LookRotation and Slerp.
The last section moves tuning values into a PlayerConfig Data Asset, which designers can edit in the Inspector. The simulation reaches it through an asset_ref<PlayerConfig> on a PlayerState component and frame.FindAsset. Two rules apply: fields the simulation reads must use deterministic types such as FP, and nothing writes to the asset while the simulation runs.
Part 3: Ground detection, respawning and spawn points
Question it answers: How do I add ground checks, triggers and custom events in a Quantum simulation?
Part 3 adds the rules a match needs. The movement system casts a ray down with frame.Physics3D.Raycast, using query options HitStatics | HitDynamics, and stores the result in PlayerState.IsGrounded. Jumping now requires it:
Keeping the flag on a component lets the animation view read it too. A large trigger volume under the map, tagged with an empty FallBox component and the OnDynamicTriggerEnter callback flag, detects players who fall. FallSystem handles ISignalOnTriggerEnter3D and raises a custom signal, OnPlayerRespawned, which PlayerJoinedSystem handles. Detection and response live in separate systems, so a respawn delay or a lives counter can be added later without touching the fall detection.
Four PlayerSpawnPoint entities, assigned by player index modulo the spawn point count, keep players from landing on top of each other. The video also adds nickname tags. The tag’s rotation comes from a plain MonoBehaviour, because it doesn’t touch the simulation; the nickname text comes from Quantum player data.
Part 4: Prop spawning and a charged dash attack
Question it answers: How do I build timed abilities, random spawns and physics hit detection that stay deterministic?
Props come from a PropSpawner declared as a singleton component, so the simulation has exactly one. PropSpawnerSystem inherits from SystemMainThread, needs no filter, gets the spawner with GetPointerSingleton, and spawns a random prop when its FrameTimer reports HasStoppedThisFrame. Randomness comes from frame.RNG, Quantum’s deterministic RNG session, which returns the same sequence on every client for the same seed. Setting RuntimeConfig.Seed once on the Unity side before the simulation starts makes each session different.
The refactoring step explains a rule worth remembering: systems must be stateless. Tuning values in a system are const or static readonly (FP can’t be const because it isn’t a built-in C# type). A value written to a system field lives outside the frame state, so it isn’t rolled back, and writing to one breaks determinism.
The attack is driven by one value, a normalized strength from 0 to 1. Holding the button accumulates time up to ChargeDurationSeconds; on release, hold time divided by charge duration becomes the strength, which scales both the dash impulse and the knockback. An AttackData component holds activation, duration and cooldown timers. Hit detection uses a Shape3DConfig from the PlayerConfig Data Asset:
csharp
var attackShape = playerConfig.AttackShape.CreateShape(frame);
var hitCollection = frame.Physics3D.OverlapShape(attackCenter, transform.Rotation, attackShape);
Hit entities go into a hash_set<EntityRef> so each target is pushed once per attack. The set carries the AllocateOnComponentAdded and FreeOnComponentRemoved attributes, because Quantum collections aren’t allocated by default and aren’t freed when their component is removed.
Part 5: Fixing floaty movement and adding hit stun
Question it answers: How do I make a physics-driven character controller in Quantum feel tight instead of floaty?
Part 1 left movement deliberately rough. Jumps rose and fell under the same soft gravity, characters slid after the input stopped, and a dash could build up unlimited speed. Part 5 fixes that while keeping the PhysicsBody3D-based controller, so props and knockback still interact through the physics engine.
Gravity now depends on the jump phase. HandleGravity reads the vertical velocity each tick and applies FallGravityScale (15) when falling, GravityScale (12) when rising and 1 in between. Movement uses Acceleration (75) as a force with input, and a Brake method reduces horizontal speed by BrakingSpeed (50) per second without input, leaving vertical velocity alone:
csharp
var newMagnitude = FPMath.Max(0, magnitude - playerConfig.BrakingSpeed * frame.DeltaTime);
velocity = velocity.Normalized * newMagnitude;
filter.PhysicsBody->Velocity = new FPVector3(velocity.X, filter.PhysicsBody->Velocity.Y, velocity.Y);
ClampHorizontalSpeed caps horizontal speed at MaxSpeed (8). Players can no longer steer during their own dash, because the movement system returns early while the attack’s activation or duration timer runs.
A hit now has consequences. When the attack overlap hits a player, it starts a StunTimer on that player’s PlayerState for StunSeconds (0.33). While it runs, the stunned player still falls under gravity but can’t steer, so the knockback plays out in full.
If you’d rather not drive the character with a physics body, Quantum’s Kinematic Character Controller is the alternative approach.
Coming next: Part 6
The final part tracks game state, adds a lives and death cycle with UI, and puts a rotating obstacle in the middle of the map. This page will be updated when it’s released.
Quantum concepts by part
Use this table to jump to the part that covers a specific Quantum feature.
Do I need to write networking code to follow this series? No. Photon Quantum distributes player inputs and handles prediction and rollback. You write gameplay systems. Nothing in the Simple Brawler project synchronizes individual objects.
Can I use Unity’s physics and math types in the simulation? No. The simulation uses Quantum’s own deterministic physics (PhysicsBody3D, PhysicsCollider3D) and fixed-point types such as FP and FPVector3. Unity types are used only on the view side, for example when reading input before converting it with ToFpVector2().
Does Photon Quantum work with Unreal or Godot? Not today. Photon Quantum is Unity-only. For Unreal and Godot, Photon Fusion is the option.
How many players can a Photon Quantum game support? The Photon Quantum documentation scopes it for up to 128 players. Simple Brawler is designed as a small party game with four spawn points; players beyond the fourth reuse a spawn point.
Is it safe to build on Quantum 3.1 while it’s in preview? The APIs used in this series are stable across releases. Check the written guide for each part if you’re on a newer SDK build.
What does it cost to run? Development is free on a 20 CCU development tier. Photon bills on peak CCU (concurrently connected users), not on messages or monthly players. A first live commercial game built with Photon Fusion or Photon Quantum can run on a free 100 CCU plan, which is hard-capped. Current tiers are on the Photon Quantum pricing page.