PUN Classic (also called PUN1) is the original and first major version of PUN. It is now replaced by PUN2 which is refactored and enhanced. We highly recommend starting new projects with PUN2 and if possible migrating existing ones from PUN1 to PUN2 by following our "Migration Notes". PUN Classic will be maintained for the coming months. We will fix important bugs and support new Unity versions but new features will be added only to PUN2.

Overview

The PUN packages from the Asset Store include several demos. None is a full-blown game but each shows a practical setup of scenes and prefabs for some aspect of a multiplayer game.

Below, we highlight a few demos of the PUN Free and PUN+ package.

Download Photon Unity Networking Free

PUN Demos
PUN Demos

The Hub Scene

When you import PUN into a new, empty project, this scene should be loaded automatically. If not, use Unity's menu:

"Window" -> "Photon Unity Networking" -> "Configure Demos (build setup)".

All included demos can be started from this "Hub Scene". You just need to setup your AppID, build and run.

Photon Unity Networking Free
Photon Unity Networking SDK

You can run the Hub in the Editor as well. Some demos use the Console of Unity to log hints. Double click a Console output line and you usually get to the code that printed it.

To learn more about the demos, open their individual scenes, too.

Back To Top

Basics

Boxes Demo

Photon Unity Networking Free
PUN Boxes Demo

Highlights:

  • Quick and easy random matchmaking (JoinRandomRoom and CreateRoom)
  • Instantiation of prefabs. InstantiateSceneObject
  • Position and rotation synchronization in fixed updates

Back To Top

Worker Demo

Photon Unity Networking Free
PUN Worker Demo

Highlights:

  • Room listing in lobby (with old UI)
  • Instantiation of a player character
  • Synchronization of character state and animation
  • In-room Chat with RPCs

Back To Top

Synchronization Demo

Photon Unity Networking Free
PUN Synchronization Demo

Highlights:

  • Shows and compares several algorithms for position-update smoothing
  • Requires keyboard input

Back To Top

Advanced

Onwership Transfer Demo

Photon Unity Networking Free
PUN Ownership Demo

Highlights:

  • Uses Ownership Transfer options of PhotonView
  • Allows to take over control of a GameObject
  • Enables current owner to reject control-requests
  • Highlights owned GameObjects with a "pin" above
  • More details

Back To Top

Pickup, Teams, Score

Photon Unity Networking Free
PUN Pickup, Team and Scores Demo

Highlights:

  • Provides a simple solution for pickups of items (even concurrent ones)
  • Synchronizes the timing when an item gets respawned
  • Uses Custom Properties to store a player's team and score
  • Uses Class Extensions to easily set and access Custom Properties

Back To Top

Feature Demos

Mecanim Demo

Photon Unity Networking Free
PUN Mecanim Demo

Highlights:

  • Animation synchronization with Animator View Component
  • Smooth position updates for a mecanim character
  • More details

Back To Top

Friends & Authentication Demo

Photon Unity Networking Free
PUN Custom Authentication Demo

Highlights:

  • Friend Finding (with fake usernames)
  • Custom authentication (optional)

To Document Top