( Mirror) (Mirror LTS) (Forum ) (Discord) (Docs) (Sponsors)
Stop worrying about networking. Because we do.
Mirror
Mirror is a high level Networking library for Unity, compatible with different low level Transports.
Mirror is for small indie games & large scale MMOs, made by the developers of uMMORPG and Cubica.
Mirror is optimized for ease of use & probability of success.
We needed a networking library that allows us to launch our games and survive the next decade.
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 overhead remote calls
[Command] void CmdUseItem(int slot) {} // client to server
[Rpc] void RpcRespawn() {} // server to all clients
[TargetRpc] void Hello() {} // server to one client
}
There’s also NetworkServer & NetworkClient. And that’s about it .
Low Level Transports
-
(default) KCP: reliable UDP
-
(built in) Telepathy: TCP
-
(built in) UNET LLAPI: UDP
-
(built in) Ninja.Websockets: Websockets
-
Libuv: TCP powered by Node.js’ native C networking
-
LiteNetLib UDP
-
Ignorance: ENET UDP
-
FizzySteam: SteamNetwork
Getting Started
Get Unity 2018/2019 LTS, download Mirror on the Asset Store, open one of the examples & press Play!
Check out our Documentation to learn how it all works.
Popular Games made with
Population: ONE
Development & Contributing
Mirror is used in production by games ranging from small indie projects to large scale MMOs that will run for a decade or more.
10 years from now if your players encounter a networking bug and most of our contributors already moved on, someone will need to fix it. Therefore it is of utmost importance for us to follow the KISS principle in order for our games to survive.
Keeping the next decade in mind, contributing fixes / tests / improvements is highly appreciated while new features have a low probability of being merged.
At this point, what we don’t add to Mirror is more important than what we do add to it!