Pun Unity

  

A free version of PUN comes with 20 CCU subscription but you can upgrade it as you need it. If you need step by step explanation of the topic, you can check our article here: Integrate Photon Pun Multiplayer Game Engine For Unity. Prerequisites: Unity 5 or later. Photon Unity Networking (PUN) package, you can download free package from Asset store. Watch Part 5: Part 1: - Fat Joe spoke to VladTV about moving to Miami after Cam'ron dissed. June 2015 edited June 2015 in Photon Unity Networking (PUN) Hey, im trying to make a LAN setup with PUN. Im trying to use the method 'PhotonNetwork.ConnectToMaster', cause to my understanding, I cant use the Photon Cloud for a LAN setup, cause they still need to be connected to the internet, however, as long as Photon can actually connect to.

  1. Photon Pun 2
  2. Unity Pun Ui
  3. Pun 2 Unity
  4. Unity Pun 2 Documentation
-->
  • Photon PUN Benefit from a tight Unity integration to easily develop and launch multiplayer games world-wide. Export to all Unity supported platforms including consoles.
  • This value defines how often PUN will call OnPhotonSerialize on controlled network objects. This is implemented in the PhotonHandler component, which integrates PUN into the Unity game loop. The updates written in OnPhotonSerialize will be queued temporarily and sent in the next LateUpdate, so a high SerializationRate also causes more sends.
Pun

In this tutorial, you will prepare for creating a shared experience using Photon Unity Networking (PUN). You will learn how to create a PUN app, import PUN assets into your Unity project, and connect your Unity project to the PUN app.

Pun

Objectives

  • Learn how to create a PUN app
  • Learn how to find and import the PUN assets
  • Learn how to connect your Unity project to the PUN app

Creating and preparing the Unity project

In this section, you will create a new Unity project and get it ready for MRTK development.

First, follow the Initializing your project and deploying your first application, excluding the Build your application to your device instructions, which includes the following steps:

  1. Creating the Unity project and give it a suitable name, for example, MRTK Tutorials
  2. Creating and configuring the scene and give the scene a suitable name, for example, MultiUserCapabilities

Then follow the Changing the Spatial Awareness Display Option instructions to:

  1. Change the MRTK configuration profile for to the DefaultHoloLens2ConfigurationProfile
  2. Change the spatial awareness mesh display options to Occlusion.

Enabling additional capabilities

In the Unity menu, select Edit > Project Settings... to open the Player Settings window, then locate the Player > Publishing Settings section:

In the Publishing Settings, scroll down to the Capabilities section and double-check that the InternetClient, Microphone, SpatialPerception, and GazeInput capabilities, which you enabled during the Configuring the Unity project step above, are enabled.

Then enable the following additional capabilities:

  • InternetClientServer capability
  • PrivateNetworkClientServer capability

Installing inbuilt Unity packages

In the Unity menu, select Window > Package Manager to open the Package Manager window, then select AR Foundation and click the Install button to install the package:

Note

You are installing the AR Foundation package because it is required by the Azure Spatial Anchors SDK you will import in the next section.

Importing the tutorial assets

Add AzurespatialAnchors SDK V2.7.1 into your unity project, to add the packages please follow this tutorial

Photon pun 2 unity

Download and import the following Unity custom packages in the order they are listed:

After you have imported the tutorial assets your Project window should look similar to this:

Tip

For a reminder on how to import a Unity custom package, you can refer to the Importing the tutorial assets instructions.

Unity photon 2

Note

After importing the MultiUserCapabilities tutorial assets package, you will see several CS0246 errors in the Console window stating that the type or namespace is missing. This is expected and will be resolved in the next section when you import the PUN assets.

Importing the PUN assets

In the Unity menu, select Window > Asset Store to open the Asset Store window, search for and select PUN 2 - FREE from Exit Games, click the Download button to download the asset package to your Unity account.

When the download is complete, click the Import button to open the Import Unity Package window:

In the Import Unity Package window, click the All button to ensure all the assets are selected, then click the Import button to import the assets:

Once Unity has completed the import process, the Pun Wizard window will appear with the PUN Setup menu loaded, you can ignore or close this window for now:

Creating the PUN application

In this section, you will create a Photon account, if you don't already have one, and create a new PUN app.

Navigate to the Photon dashboard and sign in if you already have an account you want to use, otherwise, click the Create One link and follow the instructions to register a new account:

Once signed in, click the Create a New App button:

On the Create a New Application page, enter the following values:

  • For Photon Type, select PUN
  • For Name, enter a suitable name, for example, MRTK Tutorials
  • For Description, optionally enter a suitable description
  • For Url, leave the field empty

Then click the Create button to create the new app:

Photon Pun 2

Once Photon has finished the creation process, the new PUN app will appear on your dashboard:

Connecting the Unity project to the PUN application

In this section, you will connect your Unity project to the PUN app you created in the previous section.

On the Photon dashboard, click the App ID field to reveal the app ID, then copy it to your clipboard:

In the Unity menu, select Window > Photon Unity Networking > PUN Wizard to open the Pun Wizard window, click the Setup Project button to open the PUN Setup menu, and configure it as follows:

  • In the AppId or Email field, paste the PUN app ID you copied in the previous step

Then click the Setup Project button to apply the app ID:

Once Unity has finished the PUN setup process, the PUN Setup menu will display the message Done! and automatically select the PhotonServerSettings asset in the Project window, so its properties are displayed in the Inspector window:

Congratulations

You have successfully created a PUN app and connected it to your Unity project. Your next step is to allow connections with other users so that multiple users can see each other.

Unity Pun Ui

How to make a Multiplayer Video Game in Unity using the Photon 2 plugin. For this lesson, we will teach you how to download, install, and set up the Photon 2 plugin in Unity.

Pun 2 Unity

In this Unity Multiplayer tutorial, you will learn why it is better to use the Photon 2 multiplayer plugin than other networking APIs such as the built-in Unity networking service. We will also teach you how to download, import, and set up the Photon 2 Multiplayer plugin. The Photon 2 Multiplayer plugin is our recommended plugin for creating multiplayer games in Unity. The Photon Multiplayer plugin is an easy to use API with good documentation and it supports all of the features you might need to create your multiplayer game which was my number one problem with Unity’s networking service. The Unity Networking service did not provide key multiplayer features such as Host Migration.

Photon Engine: https://dashboard.photonengine.com/en-US/account/signin
Payment Plans: https://www.photonengine.com/en/pun/pricing
Documentation: https://doc.photonengine.com/en-us/pun/current/getting-started/pun-intro
Scripting API: https://doc-api.photonengine.com/en/pun/v2/index.html

Unity Pun 2 Documentation

You will want to start by creating a new Unity Project. Once you have it created you can use Unity’s Collaboration service to back up your project. We will then want to download and import the Photon 2 multiplayer plugin. You can find it by searching for Photon PUN in the Unity asset store. You will want to download and import the PUN 2 – FREE plugin. Once you have imported all the assets you will want to go to the Photon website that I have linked to and login or create an account. After logging in you will want to click on Create New App. You will then need to select the Photon type from the drop-down menu which for us it Photon PUN. You will then need to go through the form and fill out all the required information about your project. You will then click on create to save this project.

You should now be on the home page for your Photon dashboard. You will then need to click on your new application’s AppID. You will want to copy this string value and go back to Unity. You will need to open the Photon PUN wizard window where you will paste in your AppID and hit Setup. After this, your Photon 2 Multiplayer project should be all set up and ready to start being developed.