This document is about: PUN 1
SWITCH TO

PUN Classic (v1.x) and Bolt are outdated and will not receive further updates. Of course, existing PUN Classic and Bolt projects will continue to run. New projects should use Fusion or Quantum.

1 - Lobby

Connection to Server, Room Access and Creation

Let's first tackle the core of this tutorial, being able to connect to Photon Cloud server and join a Room or create one if necessary.

  1. Create a new scene, and save it as Launcher.unity.

  2. Create a new C# script Launcher.

  3. Create an empty GameObject in the Hierarchy, named Launcher

  4. Attach the C# script Launcher to the GameObject Launcher.

  5. Edit the C# script Launcher to have its content as below

Coding Tip: if you are not copying and pasting (which is recommended, because if you do type everything, you will likely remember it better),
writing comments is very easy, type /// on the line above a method or a property and you'll have the script editor automatically create
a structured comment with for example the <summary> tag.

Back to top