Get started

You must enable Cloud Save from the Unity Dashboard before using the service. Once enabled, you can install the Cloud Save SDK into your project in the Unity Engine. You can use the Unity Dashboard to look up the data for a player.

Another way to use Cloud Save is through integration with Cloud Code.

Skip this step if you have already linked this project in the Unity Editor.

You must link your project with the Unity Dashboard to use the Cloud Save service.

  1. In Unity Editor, select EditProject Settings... > Services.
  2. Link your project.
    • If your project doesn't have a Unity project ID:

      1. Select Create a Unity Project IDOrganizations, then select an organization from the dropdown menu.
      2. Select Create project ID.
    • If you have an existing Unity project ID to use:

      1. Select Use an existing Unity project ID.
      2. Select an organization and a project from the dropdown menus.
      3. Select Link project ID.

Your Unity Project ID appears and the project is now linked to Unity cloud services. You can also access your project ID in a Unity Editor script using UnityEditor.CloudProjectSettings.projectId.

Unity Dashboard

Before you can use Cloud Save, you need to enable your project in Unity Dashboard:

  1. Go to the Unity Dashboard.
  2. Sign in using your Unity ID.
  3. In the Main Menu, select Explore Services (if not already selected).
  4. In the main window, under either the All Solutions or LiveOps tabs, select on Cloud Save.
  5. Select Set up Cloud Save.

SDK installation

To install the latest Cloud Save package for Unity:

  1. In the Unity Editor, open Window > Package Manager.
  2. In the Package Manager, select the Unity Registry list view.
  3. Search for com.unity.services.cloudsave, or locate the Cloud Save package in the list.
  4. Select the package, then select Install.

Refer to the Package Manager documentation for more information.

Optionally, you can import the Samples folder into your project to find examples of how to use the Cloud Save Client API. You can find the Samples folder in Package Manager > Cloud Save > Samples.

SDK setup

To get started with the Cloud Save SDK:

  1. Ensure the service is enabled via the Cloud Save service dashboard page.
  2. Ensure that you have installed both the Cloud Save and the Authentication SDKs.
  3. Install the required version of the package using the Package Manager.
  4. Sign in to your cloud project from within Unity Editor by selecting EditProject SettingsServices.
  5. Create a new C# MonoBehaviour script in Unity Editor. For more information refer to Creating and Using Scripts.
  6. In the script. initialize the Core SDK using await UnityServices.InitializeAsync().
  7. In the script, initialize sign in using the Authentication SDK.

Players must have a valid player ID and access token to access the Cloud Save services. You must authenticate players with the Authentication SDK before using any of the Cloud Save APIs. You can do this with the following code snippet for anonymous authentication, or refer to the documentation for the Authentication SDK for more details and other sign in methods:

await AuthenticationService.Instance.SignInAnonymouslyAsync();

The Cloud Save SDK is ready to use once you have signed in with the Authentication SDK. You can then call any of the Cloud Save methods to start interacting with your data.

Authentication

Apps typically need to know the identity of a user to provide a variety of features and services to both game developers and players to ensure security, consistency, and safety with every interaction.

Unity Authentication provides Anonymous authentication and Platform-specific authentication solutions for supported platforms, including mobile and PC. Visit How Authentication works.

The Cloud Code API uses JSON Web Token (JWT) authentication. The Cloud Save package automatically supplies JWT, but you need to make sure to sign your players in.

The fastest way to get started is to use anonymous authentication. The End to end initialization and authentication flow example demonstrates how to:

  • Start anonymous authentication using the authentication package.
  • Log the player ID in a script within Unity.