<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Ffront-end</id>
	<title>Unity.Multiplayer/articles/front-end - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Ffront-end"/>
	<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/front-end&amp;action=history"/>
	<updated>2026-12-05T11:14:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.3</generator>
	<entry>
		<id>https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/front-end&amp;diff=909&amp;oldid=prev</id>
		<title>Docs Sync: md2wiki: sync from MindAttic.Docs</title>
		<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/front-end&amp;diff=909&amp;oldid=prev"/>
		<updated>2026-11-29T20:36:37Z</updated>

		<summary type="html">&lt;p&gt;md2wiki: sync from MindAttic.Docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Drop-in front end =&lt;br /&gt;
&lt;br /&gt;
A multiplayer game needs the same screens every time: a main menu with Host and Join, somewhere to type an address or a join code, a lobby that shows the code and who is in, a &amp;quot;connecting...&amp;quot; dialog you can cancel, a clear message when something goes wrong, a way back in after a dropped connection, and an in-game Esc menu. &amp;lt;code&amp;gt;NetFrontEnd&amp;lt;/code&amp;gt; is all of that as one component. Add it beside the scene&amp;#039;s &amp;lt;code&amp;gt;NetBootstrap&amp;lt;/code&amp;gt; and press Play.&lt;br /&gt;
&lt;br /&gt;
It is built entirely from [[MindAttic.Components|MindAttic Components]] (the MindAttic design system for Unity), so it looks like every other MindAttic game and page, works with a mouse, a keyboard or a gamepad, and follows the dark or light theme.&lt;br /&gt;
&lt;br /&gt;
== Add it (two minutes) ==&lt;br /&gt;
&lt;br /&gt;
# Add MindAttic Components, and optionally Unity.Shared, to the game&amp;#039;s &amp;lt;code&amp;gt;Packages/manifest.json&amp;lt;/code&amp;gt; beside the multiplayer package. The paths assume the MindAttic repos sit beside your game&amp;#039;s folder:&amp;lt;br&amp;gt;&amp;lt;pre class=&amp;quot;md-code lang-json&amp;quot;&amp;gt;&amp;quot;com.mindattic.unity.multiplayer&amp;quot;: &amp;quot;file:../../Unity.Multiplayer/unity/com.mindattic.unity.multiplayer&amp;quot;, &amp;quot;com.mindattic.components.unity&amp;quot;: &amp;quot;file:../../MindAttic.Components/unity/com.mindattic.components.unity&amp;quot;, &amp;quot;com.mindattic.unity.shared&amp;quot;: &amp;quot;file:../../Unity.Shared/unity/com.mindattic.unity.shared&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Open your scene and run &amp;lt;strong&amp;gt;MindAttic ▸ Multiplayer ▸ Add Front End&amp;lt;/strong&amp;gt;. It networks the scene first if it is not yet (exactly what &amp;lt;strong&amp;gt;Set Up Scene&amp;lt;/strong&amp;gt; does: a NetworkManager with Unity Transport, a &amp;lt;code&amp;gt;NetBootstrap&amp;lt;/code&amp;gt; and a prefab list) and then adds &amp;lt;code&amp;gt;NetFrontEnd&amp;lt;/code&amp;gt; to the same GameObject. Running it again changes nothing. If MindAttic Components is missing it changes nothing and tells you the exact manifest line to add.&lt;br /&gt;
# Press &amp;lt;strong&amp;gt;Play&amp;lt;/strong&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
That is the whole setup. Everything below is optional.&lt;br /&gt;
&lt;br /&gt;
=== Why two extra packages, and why &amp;quot;optional&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
The front end lives in its own assembly, &amp;lt;code&amp;gt;Unity.Multiplayer.UI&amp;lt;/code&amp;gt;, inside the multiplayer package. That assembly compiles only when &amp;lt;code&amp;gt;com.mindattic.components.unity&amp;lt;/code&amp;gt; is installed (an asmdef &amp;lt;code&amp;gt;versionDefines&amp;lt;/code&amp;gt; entry defines &amp;lt;code&amp;gt;MINDATTIC_COMPONENTS&amp;lt;/code&amp;gt;, and the assembly&amp;#039;s define constraint requires it). A game that brings its own UI pays nothing for it: no extra package, no extra code, no TextMesh Pro. A Unity &amp;lt;code&amp;gt;package.json&amp;lt;/code&amp;gt; cannot list a &amp;lt;code&amp;gt;file:&amp;lt;/code&amp;gt; dependency, so the package cannot pull the two in by itself. That is why you add the manifest lines yourself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;com.mindattic.unity.shared&amp;lt;/code&amp;gt; is optional too. With it, the player&amp;#039;s name and colour come from their MindAttic profile (&amp;lt;code&amp;gt;Profiles.Current.Settings.Common&amp;lt;/code&amp;gt;), the same ones every MindAttic game uses. Without it they are kept in PlayerPrefs.&lt;br /&gt;
&lt;br /&gt;
TextMesh Pro needs its Essential Resources in the project. MindAttic Components imports them by itself the first time the editor loads, with no pop-up.&lt;br /&gt;
&lt;br /&gt;
== What the player sees ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Screen&lt;br /&gt;
! What is on it&lt;br /&gt;
|-&lt;br /&gt;
| Main menu&lt;br /&gt;
| &amp;lt;strong&amp;gt;Host&amp;lt;/strong&amp;gt;, &amp;lt;strong&amp;gt;Join by IP&amp;lt;/strong&amp;gt;, &amp;lt;strong&amp;gt;Join by code&amp;lt;/strong&amp;gt; (hidden when the NetBootstrap&amp;#039;s Join Codes is None), &amp;lt;strong&amp;gt;Settings&amp;lt;/strong&amp;gt;, the game&amp;#039;s own items, &amp;lt;strong&amp;gt;Quit&amp;lt;/strong&amp;gt;. The subtitle says who you are playing as.&lt;br /&gt;
|-&lt;br /&gt;
| Join by IP&lt;br /&gt;
| One field, &amp;lt;code&amp;gt;192.168.1.20&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;192.168.1.20:7777&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;[::1]:7777&amp;lt;/code&amp;gt;). The port defaults to the NetBootstrap&amp;#039;s, and the last address is remembered.&lt;br /&gt;
|-&lt;br /&gt;
| Join by code&lt;br /&gt;
| One field. Any case, with or without dashes; a single misread character (&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;O&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;) is corrected (see [[Unity.Multiplayer/articles/join-codes|Join codes]]).&lt;br /&gt;
|-&lt;br /&gt;
| Connecting&lt;br /&gt;
| A busy dialog (&amp;quot;Joining 192.168.1.20:7777...&amp;quot;, &amp;quot;Looking up ABC-DEF-GHJ...&amp;quot;) with &amp;lt;strong&amp;gt;Cancel&amp;lt;/strong&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| Lobby (host)&lt;br /&gt;
| The join code, large, with a &amp;lt;strong&amp;gt;Copy&amp;lt;/strong&amp;gt; button. If no code could be published, it shows &amp;quot;Players join by IP at &amp;lt;em&amp;gt;your LAN address&amp;lt;/em&amp;gt;:&amp;lt;em&amp;gt;port&amp;lt;/em&amp;gt;&amp;quot; instead. Below it is the live roster (the session&amp;#039;s [[Unity.Multiplayer/articles/players|&amp;lt;code&amp;gt;NetRoster&amp;lt;/code&amp;gt;]]): each player&amp;#039;s name and colour swatch, a &amp;lt;strong&amp;gt;Host&amp;lt;/strong&amp;gt; tag on you, &amp;quot;reconnecting...&amp;quot; on a dropped player&amp;#039;s held seat, and a remove button with a confirm. Then &amp;lt;strong&amp;gt;Leave&amp;lt;/strong&amp;gt; and &amp;lt;strong&amp;gt;Start&amp;lt;/strong&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| In game&lt;br /&gt;
| The menus are gone. &amp;lt;strong&amp;gt;Esc&amp;lt;/strong&amp;gt;, or gamepad Start or B, opens the in-game menu: &amp;lt;strong&amp;gt;Resume&amp;lt;/strong&amp;gt;, &amp;lt;strong&amp;gt;Invite players&amp;lt;/strong&amp;gt; (the host&amp;#039;s code and roster again), &amp;lt;strong&amp;gt;Settings&amp;lt;/strong&amp;gt;, the game&amp;#039;s own items, and &amp;lt;strong&amp;gt;Leave game&amp;lt;/strong&amp;gt; (&amp;lt;strong&amp;gt;End game&amp;lt;/strong&amp;gt; for the host), with a confirm.&lt;br /&gt;
|-&lt;br /&gt;
| Settings&lt;br /&gt;
| Name and colour (eight colours that read well on dark and light), plus the game&amp;#039;s own settings. It saves when you go back.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Host&amp;lt;/strong&amp;gt; publishes a join code when one can be published. With the NetBootstrap&amp;#039;s Join Codes left at Auto it tries Unity Relay when &amp;lt;code&amp;gt;com.unity.services.multiplayer&amp;lt;/code&amp;gt; is installed, then the rendezvous service when the NetBootstrap has a Rendezvous URL (the same rule as &amp;lt;code&amp;gt;NetSession.HostWithCode&amp;lt;/code&amp;gt;, see [[Unity.Multiplayer/articles/join-codes|Join codes]]); Relay or Rendezvous chosen explicitly is the only one tried. When none can, the game is hosted anyway, a toast says why there is no code, and players join by IP. For example, when Relay is installed but the project isn&amp;#039;t linked to a Unity Cloud project and there is no URL, the toast reads &amp;quot;No join code: Unity Relay isn&amp;#039;t set up: this project isn&amp;#039;t linked to a Unity Cloud project. In the editor open Edit &amp;gt; Project Settings &amp;gt; Services, ... Players can still join by IP.&amp;quot; &amp;lt;strong&amp;gt;Join by code&amp;lt;/strong&amp;gt; with a Relay code in that project shows a &amp;lt;em&amp;gt;Couldn&amp;#039;t join&amp;lt;/em&amp;gt; dialog with the same sentence. Other Relay problems are explained the same way: Relay off for the Cloud project, a missing environment, no internet. To make Relay work for a home host, see [[Unity.Multiplayer/articles/join-codes#Unity Relay for a home host (no port forwarding)|Unity Relay for a home host]]. The New Game wizard&amp;#039;s step 3 and &amp;lt;code&amp;gt;tools/link-unity-cloud.ps1&amp;lt;/code&amp;gt; set it up, and the NetBootstrap signs in anonymously as the scene starts.&lt;br /&gt;
&lt;br /&gt;
=== When a game ends ===&lt;br /&gt;
&lt;br /&gt;
Every way a session can end has its own title and sentence. The text lives in one place, Core&amp;#039;s &amp;lt;code&amp;gt;DisconnectText&amp;lt;/code&amp;gt;, so a game&amp;#039;s own UI can show the same words with &amp;lt;code&amp;gt;DisconnectText.For(session.LastDisconnect)&amp;lt;/code&amp;gt;. When the server said something more specific, such as a kick reason or the two versions, that appears as a second, muted line.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Reason&lt;br /&gt;
! Title&lt;br /&gt;
! What it says&lt;br /&gt;
|-&lt;br /&gt;
| Version mismatch&lt;br /&gt;
| Different version&lt;br /&gt;
| Your game is a different version from the host&amp;#039;s. Update both to the same version to play together.&lt;br /&gt;
|-&lt;br /&gt;
| Protocol mismatch&lt;br /&gt;
| Different build&lt;br /&gt;
| Your game and the host&amp;#039;s were built from different code. Install the same build on both.&lt;br /&gt;
|-&lt;br /&gt;
| Full&lt;br /&gt;
| Game full&lt;br /&gt;
| Every seat in this game is taken. Try again later.&lt;br /&gt;
|-&lt;br /&gt;
| Banned&lt;br /&gt;
| Can&amp;#039;t join&lt;br /&gt;
| You are banned from this game.&lt;br /&gt;
|-&lt;br /&gt;
| Wrong password&lt;br /&gt;
| Wrong password&lt;br /&gt;
| This game needs a password, and the one given did not match.&lt;br /&gt;
|-&lt;br /&gt;
| Bad payload&lt;br /&gt;
| Couldn&amp;#039;t join&lt;br /&gt;
| The host could not read your join request. Update both games to the same version.&lt;br /&gt;
|-&lt;br /&gt;
| Kicked&lt;br /&gt;
| Removed from the game&lt;br /&gt;
| The host removed you from the game. (The host&amp;#039;s reason follows.)&lt;br /&gt;
|-&lt;br /&gt;
| Server shut down&lt;br /&gt;
| Game ended&lt;br /&gt;
| The host closed the game.&lt;br /&gt;
|-&lt;br /&gt;
| Could not connect&lt;br /&gt;
| Couldn&amp;#039;t connect&lt;br /&gt;
| No game answered. Check the address or code, and that the host is still running.&lt;br /&gt;
|-&lt;br /&gt;
| Timed out&lt;br /&gt;
| Connection lost&lt;br /&gt;
| The game stopped responding. Check your internet connection and try again.&lt;br /&gt;
|-&lt;br /&gt;
| Transport failure&lt;br /&gt;
| Network error&lt;br /&gt;
| The network connection failed. Check your connection and try again.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leaving on purpose (Leave, Cancel) shows nothing.&lt;br /&gt;
&lt;br /&gt;
=== Reconnecting ===&lt;br /&gt;
&lt;br /&gt;
When a client&amp;#039;s connection is lost (&amp;lt;code&amp;gt;TimedOut&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;TransportFailure&amp;lt;/code&amp;gt;), the front end does not drop the player back to the main menu. It shows &amp;quot;Connection lost. Getting your seat back (try 1 of 5)...&amp;quot; with a progress bar and &amp;lt;strong&amp;gt;Cancel&amp;lt;/strong&amp;gt;, and rejoins the same way the player first joined (the same address, or the same code looked up again). It sends the same player token, so within the server&amp;#039;s &amp;lt;code&amp;gt;ReconnectGraceSeconds&amp;lt;/code&amp;gt; the player gets their seat and player object back (see [[Unity.Multiplayer/articles/reconnect-seats|Reconnect and seats]]). The tries wait 1, 2, 4, 8, 8 seconds by default. A refusal (full, banned) or a kick stops the retries. If every try fails, the player sees &amp;quot;Connection lost&amp;quot; and the main menu.&lt;br /&gt;
&lt;br /&gt;
A server that shut down, a kick and a refusal are never retried: they were deliberate, and retrying would only fail again. The rule is Core&amp;#039;s &amp;lt;code&amp;gt;ReconnectPolicy&amp;lt;/code&amp;gt;, so it is covered by plain &amp;lt;code&amp;gt;dotnet test&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== The player&amp;#039;s name and colour ==&lt;br /&gt;
&lt;br /&gt;
The front end reads them from an &amp;lt;code&amp;gt;IPlayerIdentitySource&amp;lt;/code&amp;gt; just before it hosts or joins. It puts them on the session&amp;#039;s &amp;lt;code&amp;gt;Identity&amp;lt;/code&amp;gt;, which goes to the server in the connection approval payload. The server builds the session&amp;#039;s [[Unity.Multiplayer/articles/players|roster]] from them, which every peer has (&amp;lt;code&amp;gt;session.Roster&amp;lt;/code&amp;gt;: each player&amp;#039;s name, colour, seat, ping, host flag), and that is what the lobby shows. A game reads them the same way, from &amp;lt;code&amp;gt;NetRoster&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Changed in Settings during a game, the name and colour are asked of the server at once (&amp;lt;code&amp;gt;NetRoster.RequestChange&amp;lt;/code&amp;gt;): everyone sees the change, a refusal shows as a toast with the server&amp;#039;s reason, and an accepted change is saved back to the identity source. Any accepted change to the player&amp;#039;s own name or colour is saved the same way, including one the game asks for itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-csharp&amp;quot;&amp;gt;public interface IPlayerIdentitySource&lt;br /&gt;
{&lt;br /&gt;
    string DisplayName { get; }&lt;br /&gt;
    Color Color { get; }&lt;br /&gt;
    string StoredIn { get; }                 // &amp;quot;your MindAttic profile (Default)&amp;quot;, &amp;quot;this computer&amp;quot;&lt;br /&gt;
    void Save(string displayName, Color color);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default is &amp;lt;code&amp;gt;ProfileIdentitySource&amp;lt;/code&amp;gt; when Unity.Shared is installed, else &amp;lt;code&amp;gt;PlayerPrefsIdentitySource&amp;lt;/code&amp;gt;. A game with its own accounts sets its own:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-csharp&amp;quot;&amp;gt;frontEnd.Identity = new MyAccountIdentity();&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Names are cleaned the way the server accepts them (&amp;lt;code&amp;gt;PlayerIdentitySources.CleanName&amp;lt;/code&amp;gt;, which is Core&amp;#039;s &amp;lt;code&amp;gt;PlayerNames.Clean&amp;lt;/code&amp;gt;: trimmed, no control or invisible characters, single spaces, at most 32 characters, &amp;quot;Player&amp;quot; when empty). The NetBootstrap&amp;#039;s own Display Name and Player Color fields are overridden by the front end.&lt;br /&gt;
&lt;br /&gt;
== Hooks for the game ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-csharp&amp;quot;&amp;gt;NetFrontEnd frontEnd = NetFrontEnd.Instance;   // or a serialized reference&lt;br /&gt;
&lt;br /&gt;
// Events.&lt;br /&gt;
frontEnd.SessionStarted += session =&amp;gt; { };      // a host is running / a client is in&lt;br /&gt;
frontEnd.GameStarted    += () =&amp;gt; LoadLevel();   // the menus handed over: host pressed Start, client got in, dedicated server running&lt;br /&gt;
frontEnd.Left           += why =&amp;gt; ShowTitle();  // back at the main menu, with why (LocalLeave for the player&amp;#039;s own leave)&lt;br /&gt;
frontEnd.Reconnected    += () =&amp;gt; { };           // a lost connection came back&lt;br /&gt;
frontEnd.StateChanged   += state =&amp;gt; { };        // Menu, Connecting, Lobby, InGame, Reconnecting&lt;br /&gt;
&lt;br /&gt;
// The game&amp;#039;s own screens and items.&lt;br /&gt;
frontEnd.AddScreen(&amp;quot;Options&amp;quot;, s =&amp;gt; s.AddRange(&amp;quot;Volume&amp;quot;, 0, 100, 80, SetVolume, true));   // a button in both menus&lt;br /&gt;
frontEnd.AddScreen(&amp;quot;Credits&amp;quot;, s =&amp;gt; s.AddText(&amp;quot;Made by...&amp;quot;), MenuPlacement.MainMenu);&lt;br /&gt;
frontEnd.AddMainMenuItems(s =&amp;gt; s.AddButton(&amp;quot;Tutorial&amp;quot;, StartTutorial));                 // before Quit&lt;br /&gt;
frontEnd.AddPauseMenuItems(s =&amp;gt; s.AddButton(&amp;quot;Restart level&amp;quot;, RestartLevel));            // before Leave&lt;br /&gt;
frontEnd.AddSettingsItems(s =&amp;gt; s.AddToggle(&amp;quot;Show ping&amp;quot;, showPing, v =&amp;gt; showPing = v));  // under name and colour&lt;br /&gt;
&lt;br /&gt;
// Keep the menus out of the way (a cutscene, your own title screen first).&lt;br /&gt;
frontEnd.MenusVisible = false;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;code&amp;gt;Add...Items&amp;lt;/code&amp;gt; callback adds items to a screen the front end owns. The in-game menu is built once, so an &amp;lt;code&amp;gt;AddPauseMenuItems&amp;lt;/code&amp;gt; callback runs exactly once (when the menus are built, or at once if they already are) and its items stay for the front end&amp;#039;s life, across games. Refresh what they show from the screen&amp;#039;s &amp;lt;code&amp;gt;Shown&amp;lt;/code&amp;gt; event, which fires once each time the menu opens:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-csharp&amp;quot;&amp;gt;frontEnd.AddPauseMenuItems(s =&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    MaToggle shake = s.AddToggle(&amp;quot;Screen shake&amp;quot;, false, on =&amp;gt; player.Shake = on);&lt;br /&gt;
    s.Shown += () =&amp;gt; shake.SetValueWithoutNotify(player.Shake);   // hooked once, never piles up&lt;br /&gt;
});&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An assembly that calls these hooks references &amp;lt;code&amp;gt;Unity.Multiplayer.UI&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;MindAttic.Components.Unity&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;MindAttic.Components.Unity.Core&amp;lt;/code&amp;gt; (the default &amp;lt;code&amp;gt;Assembly-CSharp&amp;lt;/code&amp;gt; references them all already). &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; is a MindAttic Components &amp;lt;code&amp;gt;MenuScreen&amp;lt;/code&amp;gt;, so everything it offers (&amp;lt;code&amp;gt;AddButton&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;AddToggle&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;AddRange&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;AddSelect&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;AddTextbox&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;AddText&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;AddSection&amp;lt;/code&amp;gt;, ...) is available. &amp;lt;code&amp;gt;frontEnd.MainMenu&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;frontEnd.PauseMenu&amp;lt;/code&amp;gt; are the two &amp;lt;code&amp;gt;MenuStack&amp;lt;/code&amp;gt;s, if you need more.&lt;br /&gt;
&lt;br /&gt;
Every button is also a method, so a game can drive the same flow from its own UI or a quick-play button. You still get the dialogs and the reconnect: &amp;lt;code&amp;gt;Host()&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;HostAsync()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;JoinByAddress(text)&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;JoinByAddressAsync&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;JoinByCode(code)&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;JoinByCodeAsync&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StartGame()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Leave()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ConfirmLeave()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OpenSettings()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Votes ===&lt;br /&gt;
&lt;br /&gt;
With a &amp;lt;code&amp;gt;NetVotes&amp;lt;/code&amp;gt; component beside the &amp;lt;code&amp;gt;NetBootstrap&amp;lt;/code&amp;gt; (see [[Unity.Multiplayer/articles/votes|Votes]]), every vote shows in a ready-made overlay under the same theme: the question, the tally and countdown, Yes / No, and a toast with the result. It appears only in game, never over the menus, and a headless peer never builds it.&lt;br /&gt;
&lt;br /&gt;
=== Loading a level when the host presses Start ===&lt;br /&gt;
&lt;br /&gt;
Either handle &amp;lt;code&amp;gt;GameStarted&amp;lt;/code&amp;gt; yourself, or set &amp;lt;strong&amp;gt;Game Scene&amp;lt;/strong&amp;gt; on a settings asset: the server then loads it for everyone through [[Unity.Multiplayer/articles/topologies|scene flow]] when the host presses Start. The scene must be in the build&amp;#039;s scene list, and the NetworkManager must have scene management on.&lt;br /&gt;
&lt;br /&gt;
== The settings asset ==&lt;br /&gt;
&lt;br /&gt;
Optional. &amp;lt;strong&amp;gt;Assets ▸ Create ▸ MindAttic ▸ Multiplayer ▸ Front End Settings&amp;lt;/strong&amp;gt;, then drop it on the NetFrontEnd&amp;#039;s &amp;lt;strong&amp;gt;Settings&amp;lt;/strong&amp;gt; field. Without one, the defaults below apply.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field&lt;br /&gt;
! Default&lt;br /&gt;
! What&lt;br /&gt;
|-&lt;br /&gt;
| Title&lt;br /&gt;
| product name&lt;br /&gt;
| The main menu&amp;#039;s title&lt;br /&gt;
|-&lt;br /&gt;
| Join By Address / Join By Code / Settings Screen / Quit Button&lt;br /&gt;
| on&lt;br /&gt;
| Which main-menu buttons appear (Quit never on WebGL)&lt;br /&gt;
|-&lt;br /&gt;
| Dim Behind Menu&lt;br /&gt;
| on&lt;br /&gt;
| Dim the scene behind the main menu&lt;br /&gt;
|-&lt;br /&gt;
| Show Lobby&lt;br /&gt;
| on&lt;br /&gt;
| Off goes straight into the game after hosting&lt;br /&gt;
|-&lt;br /&gt;
| Game Scene&lt;br /&gt;
| empty&lt;br /&gt;
| A scene the server loads for everyone on Start&lt;br /&gt;
|-&lt;br /&gt;
| Kick Message&lt;br /&gt;
| &amp;quot;The host removed you from the game.&amp;quot;&lt;br /&gt;
| What a removed player is told&lt;br /&gt;
|-&lt;br /&gt;
| Pause Menu / Pause Title&lt;br /&gt;
| on / &amp;quot;Menu&amp;quot;&lt;br /&gt;
| The in-game Esc menu&lt;br /&gt;
|-&lt;br /&gt;
| Auto Reconnect / Reconnect Attempts / First Delay / Max Delay&lt;br /&gt;
| on / 5 / 1 s / 8 s&lt;br /&gt;
| The reconnect policy (or set &amp;lt;code&amp;gt;frontEnd.Reconnect&amp;lt;/code&amp;gt; in code)&lt;br /&gt;
|-&lt;br /&gt;
| Theme&lt;br /&gt;
| current&lt;br /&gt;
| A MindAttic &amp;lt;code&amp;gt;ThemeTokens&amp;lt;/code&amp;gt; asset for the menus&lt;br /&gt;
|-&lt;br /&gt;
| Sorting Order&lt;br /&gt;
| 500&lt;br /&gt;
| The menus&amp;#039; canvas order, above the game&amp;#039;s own UI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Servers, bots and CI: no UI, ever ==&lt;br /&gt;
&lt;br /&gt;
A headless process never creates a canvas, a menu or a dialog. That covers batch mode, &amp;lt;code&amp;gt;-nographics&amp;lt;/code&amp;gt;, a Dedicated Server build and a CI run, and also any launch that picked its role with &amp;lt;code&amp;gt;-mode&amp;lt;/code&amp;gt; (a server) or &amp;lt;code&amp;gt;-bot&amp;lt;/code&amp;gt; (a bot client, even in a window; see [[Unity.Multiplayer/articles/bots|Bots]]). The rule is Core&amp;#039;s &amp;lt;code&amp;gt;NetLaunch.ShowsMenus&amp;lt;/code&amp;gt;. The component still follows the session, so &amp;lt;code&amp;gt;SessionStarted&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GameStarted&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Left&amp;lt;/code&amp;gt; fire, and messages go to the log. The same scene therefore runs as the player&amp;#039;s game, a dedicated server and a bot.&lt;br /&gt;
&lt;br /&gt;
== The Front End sample ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Window ▸ Package Manager ▸ MindAttic Multiplayer ▸ Samples ▸ Front End&amp;lt;/strong&amp;gt; imports &amp;lt;code&amp;gt;FrontEnd.unity&amp;lt;/code&amp;gt;. It is the Minimal sample&amp;#039;s arena with the front end instead of a hand-made menu. Each square is in its owner&amp;#039;s chosen colour, with their name, and &amp;lt;code&amp;gt;FrontEndGame.cs&amp;lt;/code&amp;gt; shows the hooks above. Its README lists every file.&lt;br /&gt;
&lt;br /&gt;
== Testing your game&amp;#039;s menus ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Unity.Multiplayer.UI.Testing&amp;lt;/code&amp;gt; drives a game&amp;#039;s own front end from its PlayMode tests, menus included in a batch-mode run (&amp;lt;code&amp;gt;FrontEndTesting.ForceMenus&amp;lt;/code&amp;gt;). See [[Unity.Multiplayer/articles/testing#Testing your front end|Testing your front end]].&lt;br /&gt;
&lt;br /&gt;
== Where it is tested ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;dotnet test tests/Core.Tests&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;DisconnectText&amp;lt;/code&amp;gt; for every reason and rejection, &amp;lt;code&amp;gt;ReconnectPolicy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;HostAddress&amp;lt;/code&amp;gt; parsing, and &amp;lt;code&amp;gt;NetLaunch.ShowsMenus&amp;lt;/code&amp;gt; (FrontEndRulesTests).&lt;br /&gt;
* &amp;lt;code&amp;gt;tests/run-playmode.ps1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Unity.Multiplayer.UI.Tests&amp;lt;/code&amp;gt;. Two front ends, a host and a client over real Unity Transport on loopback, are driven through their menus:&lt;br /&gt;
** hosting shows the lobby; Join by IP gets the client in; the roster shows the client&amp;#039;s name and colour from the approval payload; Start enters the game; Leave from the in-game menu returns to the main menu;&lt;br /&gt;
** join by code uses the code the lobby shows, through an in-process rendezvous server, also with Join Codes left at Auto and only a rendezvous URL configured;&lt;br /&gt;
** with Relay installed but the project not linked, Host toasts how to link it and hosts for joining by IP, and Join by code explains it in a dialog;&lt;br /&gt;
** the in-game menu&amp;#039;s game items run once and their &amp;lt;code&amp;gt;Shown&amp;lt;/code&amp;gt; handlers fire once per open, across several games;&lt;br /&gt;
** a version mismatch and a kick each show their dialog;&lt;br /&gt;
** a lost connection (a UDP relay that cuts the link) reconnects to the same seat; a link that never comes back gives up with a message;&lt;br /&gt;
** Settings saves the name and colour, and the new name reaches the server; changed mid-game, it reaches the host&amp;#039;s lobby at once and is saved once the server accepts it;&lt;br /&gt;
** a headless scene with a real NetBootstrap builds no UI;&lt;br /&gt;
** the profile-backed identity reads and writes the MindAttic profile.&lt;br /&gt;
* &amp;lt;code&amp;gt;tests/run-editmode.ps1&amp;lt;/code&amp;gt;: Add Front End networks the scene and adds the component, a second run changes nothing, undo removes it, and with the packages missing it changes nothing and names the exact manifest lines.&lt;br /&gt;
* &amp;lt;code&amp;gt;tests/run-sample.ps1 -Sample FrontEnd&amp;lt;/code&amp;gt;: the sample as Package Manager imports it, wired by the wizard, serving headless with no UI, and each square carrying its player&amp;#039;s name and colour on every peer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-crumb&amp;quot;&amp;gt;Part of [[Unity.Multiplayer]].&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-source&amp;quot;&amp;gt;From [https://github.com/mindattic/Unity.Multiplayer/blob/main/docs/articles/front-end.md Unity.Multiplayer/docs/articles/front-end.md] via MindAttic.Docs; synced automatically, so edit the repo, not this page.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Unity.Multiplayer]]&lt;/div&gt;</summary>
		<author><name>Docs Sync</name></author>
	</entry>
</feed>