Step 4 of 4

See your first player.

Run the example in your Unity project and check the response there.

First player request in UnityUnity2:40
Open video separately ↗

Finish setup before confirming your first request. Connect

Attach HorizonTest.cs to a GameObject and press Play

C#
Assets/Scripts/HorizonTest.cs
horizOn call
1using PM.horizOn.Cloud.Core;
2using PM.horizOn.Cloud.Manager;
3using UnityEngine;
4​
5// Attach this script to a GameObject in your first scene.
6// horizOn: initialize, connect to the nearest server, sign in anonymously.
7public class HorizonTest : MonoBehaviour
8{
9 async void Start()
10 {
11 // Step 1: Initialize SDK
12 HorizonApp.Initialize();
13​
14 // Step 2: Connect to server
15 var server = new HorizonServer();
16 bool connected = await server.Connect();
17​
18 if (!connected)
19 {
20 Debug.LogError("Failed to connect to horizOn server");
21 return;
22 }
23​
24 Debug.Log($"Connected to: {server.ActiveHost}");
25​
26 // Step 3: Sign in or sign up
27 bool signedIn = await UserManager.Instance.SignUpAnonymous("TestPlayer");
28​
29 if (signedIn)
30 {
31 Debug.Log($"Signed in as: {UserManager.Instance.CurrentUser.DisplayName}");
32 }
33 }
34}

Here is what should happen

The anonymous player signs in successfully. Your Console, Output or terminal shows a successful response with a player name or userId. You can also check the player in the selected project’s Users area.

Confirm the result from your own project. Existing dashboard players do not prove this new connection.

Open Users
No response yet?

Check the active project key, JSON import and backend addresses. Restart your project after importing. For a 401, check the full key; for network errors, check the reachable backend address and console output.

Also: check the API in the dashboard

The API Explorer helps with debugging. Still verify the first request from your own game afterwards.

API Explorer1:05
Open video separately ↗
Open the API Explorer
Back