Mirror
#1 Open Source Unity Networking Library
Install / Use
/learn @MirrorNetworking/MirrorREADME

It's only the dreamers who ever move mountains.
Mirror Networking
The #1 free open source game networking library for Unity 2019 / 2020 / 2021 / 2022 / 6.
Used in production by major hits like Population: ONE and over 1000 Steam Games.
Originally based on UNET: battle tested since 2014 for 10 years and counting!
Mirror is stable, modular & easy to use for all types of games, even small MMORPGs 🎮.
Made in 🇩🇪🇺🇸🇬🇧🇸🇬🇹🇼 with ❤️.
Features
Mirror comes with a wide variety of features to support all game genres.<br> Many of our features quickly became the norm across all Unity netcodes!<br>
| Feature | Description | Status | |-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------| | 🎛 Transports | UDP, TCP, Websockets, Steam, Relay and more. | Stable | | 🪜 Interest Management | Spatial Hashing & Distance Checker to partition the world. | Stable | | ↗️ SyncDirection | Server & Client Authority - per component with one click. | Stable | | 🐌 Latency Simulation | Simulate latency, packet loss & jitter locally. | Stable | | 🧲 Batching | Minimize message overhead via batching automatically. | Stable | | 💌 RPCs & SyncVars | Synced vars and remote function calls built in & safe. | Stable | | 🙅♀️ Allocation Free | Free of runtime allocations and no GC (except Transports). | Stable | | 🛞 Transform & Physics | Transform & Physics sync built in. | Stable | | 👩🍼 Child Components | Put networked components on anything. | Stable | | 🪚️ IL Post Processing | Zero overhead [Rpcs] and [Commands] via IL post processing! | Stable | | ☁️ Two Click Hosting | (Optional) <a href="https://mirror-networking.gitbook.io/docs/hosting/edgegap-hosting-plugin-guide">Build & Push</a> directly from Unity Editor to the Cloud. | Stable | | | | | | 📏 Snapshot Interpolation | Perfectly smooth movement for all platforms & genres. | Stable | | 🔫 Lag Compensation | Roll back state to see what the player saw during input. | Beta | | 🔒 Encryption | Secure communication with end-to-end encryption. | Beta | | 🔒 Cheat Detection | Mirror Guard safely detects Melon Loader & more. | Beta | | 🚀 Unreliable Mode | Quake style Unreliable SyncMode for any component. | Development | | | | | | 🧙♂️ General Purpose | Mirror supports all genres for all your games! | | | 🧘♀️ Stable API | Long term (10 years) stability instead of new versions! | | 🔬 Battle Tested | Mirror serves over 100 million players. It just works! | | | 💴 Free & Open Source | MIT licensed without any restrictions to minimize risk! | | | ❤️ Community | Join our Discord with nearly 15.000 developers world wide! | | | 🧜🏻♀️ Long Term Support | Maintained since 2014 with optional LTS version! | | | | | | | 📐 Bitpacking | Optimized compression (bools as 1 bit etc.) | Researching | | 🏎 Prediction | Simulate Physics locally & apply server corrections. | Researching |
Architecture
The Server & Client are ONE project in order to achieve maximum productivity.
Simply use NetworkBehaviour instead of MonoBehaviour.
Making multiplayer games this way is fun & easy:
public class Player : NetworkBehaviour
{
// Synced automatically
[SyncVar] public int health = 100;
// Lists, Dictionaries, Sets too
SyncList<Item> inventory = new SyncList<Item>();
// Server/Client-only code
[Server] void LevelUp() {}
[Client] void Animate() {}
void Update()
{
// isServer/isClient for runtime checks
if (isServer) Heal();
if (isClient) Move();
}
// Zero over
