Guest Login

If you're not using any specific first party platform or just want something simple, you can use our Guest Login feature to create player sessions.

Guest Login provides the player with a simple reusable session which supports most of LootLocker's features, with the exception of platform specific features such as payments through Steam etc.

Register a Session

We'll start by creating a new empty Game Object in your scene and calling it GameManager. Feel free to skip this if you already have a GameManager or similar in your game.

Then in this new GameObject you can add a new script called GameManager

Open up your new script in your editor of choice and add the following code.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LootLocker.Requests;

public class GameManager : MonoBehaviour
{
    void Start()
    {
        LootLockerSDKManager.StartGuestSession((response) =>
        {
            if (!response.success)
            {
                Debug.Log("error starting LootLocker session");

                return;
            }

            Debug.Log("successfully started LootLocker session");
        });
    }
}

To confirm that everything is running without errors, you can start your game and check the console for the correct Debug.Log message.

Last updated