Skip to main content
How to install PlayFab into Unity

How to install PlayFab into Unity

This quickstart helps you deploy PlayFab SDK before doing any API call in the Unity engine. Before continuing, make sure you have completed Getting started for developers, which ensures you have a PlayFab account and are familiar with the PlayFab Game Manager.

Download PlayFab SDK

Download the PlayFab SDK for Unity on your computer. Sources are available on GitHub

You can also use the Editor Extension package, but as this component only rely on the PlayFab Account Authentication and we want to manage this mechanism with our Corporate Azure AD Account, we will proceed manually.

Install & Setup PlayFab SDK in Unity

  1. Open Unity Hub and Select Create a new project.
  2. Select 2D Template and define your Project Name and location.

At this point, you have a blank project with only 1 scene store in your Asset Folder.

Deploy PlayFab SDK

From the Unity editor, go to Assets > Import Package > Custom Package and then select the downloaded PlayFabSDK package.

If you already have an old SDK Version imported, you should delete the folder before to avoid any issue later on

Configure PlayFab SDK

You have to define the Game Title that will host Player Authentication for your game. You will find your Title ID on your Studio page

This can be done on 2 ways :

  • Add PlayFabSettings.TitleId = "YourTitleID"; somewhere in your code - or
  • In your Unity Project tab, navigate to: assets/PlayFabSDK/Shared/Public/Resources and select the PlayFabSharedSettings and fill the Title Id field.

Test your PlayFab SDK

To check the this import have been done well, you can follow

Share (for immortality)

Laurent LEFEVRE avatar

Laurent LEFEVRE

Producer

I'm a Microsoft employee, working on Technology Strategy for large Enterprise account. I focus on industry business trends and explain how you can leverage Azure Game Stack & Xbox services. I assume that I don't know anything. This is a great habit to do a full knowledge refresh and avoiding bias.