Samples
The Quantum Forge Unity package includes several sample projects demonstrating different aspects of quantum mechanics in games. Install them from the Unity Package Manager window.
Actions
A qubit and a qutrit, each with buttons for Hadamard, Cycle, Clock, PhaseRotate, InverseHadamard and MeasureProperties.
What you'll learn:
- How to apply Hadamard, Cycle, Clock, PhaseRotate and InverseHadamard
- Using the ProbabilityTracker and PhaseTracker to visualize state changes
- Wiring quantum actions to UI buttons via Unity Events
- Measuring with MeasureProperties
Platformer
A simple platformer where the player is a single QuantumProperty on a "Lane" basis with two values, top and bottom. Two copies of the player are shown, and each one appears when its lane has nonzero probability. Zones in the level apply Hadamard and phase operations when the player enters them.
What you'll learn:
- A QuantumProperty on a player, with a two-value Basis
- Collider zones that apply Hadamard and phase operations
- Showing superposition by switching objects on the ProbabilityTracker's output
- Driving visuals from probabilities and phase (ScaleProbability, RotateOnPhase)
Roshambo
A quantum version of rock-paper-scissors using a 3-element Basis.
What you'll learn:
- Creating a custom Basis with named values (rock, paper, scissors)
- Superposition across 3 states (not just 2)
- Player-controlled measurement timing
- Quantum advantage: the ability to "be all three at once" until measured
Installing Samples
- Open the Package Manager (Window > Package Manager)
- Select Quantum Forge from the list
- Expand the Samples section
- Click Import next to the sample you want
Samples are copied to Assets/Samples/Quantum Forge/{version}/.
Building Your Own
Use the samples as starting points. The key pattern for any quantum game in Unity:
- Define a Basis: what states can your quantum objects have?
- Add QuantumProperty: attach to any GameObject
- Choose your gates: which operations make sense for your gameplay?
- Add Trackers: visualize the quantum state for debugging and UI
- Measure at dramatic moments: measurement is the "reveal", so save it for impact
See Advanced Topics for entanglement patterns and performance tips.