Game ideas & features

Your next feature

Authentication

Sign in a test player and reuse their session.

Unity
Your visible result

A test player is signed in. Follow-up requests use their session.

Video coming later

This step does not have a video yet. The guide and MCP request are ready to use.

Integrate player sign-in

Build this feature

You can preview the guide. Running it requires an active project key. Prepare project

SDK installed and project configuration imported.

C#
Assets/Scripts/AuthenticationDemo.cs
horizOn callSetup
1using UnityEngine;
2using PM.horizOn.Cloud.Core;
3using PM.horizOn.Cloud.Manager;
4​
5// Attach this script to a GameObject in your first scene.
6public class AuthenticationDemo : MonoBehaviour
7{
8 async void Start()
9 {
10 // Setup: initialize and connect.
11 HorizonApp.Initialize();
12 await new HorizonServer().Connect();
13​
14 // horizOn: create a player account and sign in.
15 // Anonymous sign-up (auto-caches token for session restore)
16 await UserManager.Instance.SignUpAnonymous("PlayerName");
17​
18 // Email sign-up
19 await UserManager.Instance.SignUpEmail("user@example.com", "password", "DisplayName");
20​
21 // Email sign-in
22 await UserManager.Instance.SignInEmail("user@example.com", "password");
23​
24 // Check authentication state
25 if (UserManager.Instance.IsSignedIn)
26 {
27 var user = UserManager.Instance.CurrentUser;
28 Debug.Log($"Welcome, {user.DisplayName}!");
29 }
30 }
31}

Test your new feature.

A test player is signed in. Follow-up requests use their session.

Choose the same project in the dashboard as in your game configuration.

Endpoints
  • POST/user-management/signup
  • POST/user-management/signin
All endpoints in the API reference
Our suggestion for your next step

Give every round a high score.

Save the score after a round and show who's ahead. Keep using your connection and player session.