This document is about: FUSION 2
SWITCH TO

Getting Started

Project Setup

Each download is a complete Unity project.

  1. Unzip the downloaded package and open the project folder with Unity 6000.3.18f1.
  2. Create a Fusion 2 AppId following Creating a Fusion 2 AppId.
  3. Open Tools > Fusion > Realtime Settings and paste the AppId into the App Id Fusion field of the selected PhotonAppSettings asset.

Running in Editor

Both projects start from the Menu scene.

  1. Open the scene Assets/Scenes/Menu.unity and enter Play Mode.
  2. Enter a nickname and a room name. An empty nickname field uses the generated Player name shown in the field.
  3. Start the session:
    • In the Client Host project, START HOST starts the session as host or joins it as a client when a session with the room name already runs. START CLIENT joins as a client.
    • In the Shared Authority project, START joins the session or creates it.
  4. The Game scene loads with the pre-game screen. The host, or the master client in the Shared Authority project, presses Start game, the other players see Waiting for host or Waiting for master.
  5. The round lasts 180 seconds and ends earlier when every ship is out of lives. The winner screen shows the player with the highest score, remaining lives break a tie. After 4 seconds every client returns to the menu.
Main menu
Main menu
Pre-game screen
Pre-game screen

Controls

Keyboard and Mouse

  • W or Up Arrow - Thrust forward
  • S or Down Arrow - Thrust backward
  • A, D or Left Arrow, Right Arrow - Rotate
  • Left Mouse Button or Enter - Fire, one shot per press

Building and Testing Multiplayer

The build settings list the Menu and Game scenes in this order. Keep both scenes in the list, StartMenu stops with an error when the Game scene is missing.

To test multiplayer, run a build next to the Unity Editor or start several builds on one machine. Enter the same room name on every client and join before the round starts, GameManager.StartGame closes the session to new players. Clients are only matched together when they use the same AppId, AppVersion and region.

In the Client Host project StartMenu starts the NetworkRunner with GameMode.AutoHostOrClient for START HOST, the first client of a session becomes the host and later clients connect to it. START CLIENT uses GameMode.Client.

In the Shared Authority project StartMenu starts the NetworkRunner with GameMode.Shared, every client joins the session and controls its own spaceship.

Last updated on

Back to top