⚒️ Getting Started

Before all else, we must install the Trail SDK and prepare your game project for the web.

Follow the steps in this guide, and remember that you can always write us a message if you have any questions.

13971397

The Trail SDK extension for Unity.

Get the Trail SDK Editor Extension for Unity

The Trail SDK Editor Extension is the easiest and fastest way to bring your game to the web. It contains the Trail SDK, a library that enables the entire suite of Trails tools for porting, building, uploading, & testing mobile games to the web.

Get the SDK Editor Extension Developer Access required.

Don't have developer access? We'd be happy to help you!

Add the Trail SDK to your project

1) Import the Asset Package into your project by clicking the downloaded Trail SDK .unitypackage with your Unity project running.

2) If your project is not already set up to use WebGL as the target platform, go to File > Build Settings, select WebGL and click Switch Platform. This may take a while, depending on the size of your project.

3) Open the Trail SDK window via the Unity menu: Window > Trail > Trail SDK.

995995

📘

Your firewall might now prompt you. The Editor Extension requires a connection to Trail to function, so make sure you click Allow access.

3) Log in with your Trail developer account.

4) Select your game in the Game dropdown. This lets us know which Trail game uploaded builds should belong to.

All done 👍!
Now let's just make sure the SDK initializes properly!

Making sure the SDK initializes

1) Open the Editor Companion. This will allow your game to establish a connection with Trail while playing it in Unity, which in turn will initialize the Trail SDK.

601601

The Editor Companion lets you run games with Trail inside of Unity.

2) With the Editor Companion browser window still opened, enter Play Mode in Unity.

450450

3) With the connection to Trail established via the Editor Companion, the SDK should now initialize.
This may take a few seconds.

17081708

4) Open the Unity console. If the Trail SDK has correctly initialized, the log entry trailsdk INF - Initialization successful should appear in your console:

trailsdk INF - Initializing, SDK version: 2.0.0-750a2917, Unity version: 2022.1.1f, dev_host: "127.0.0.1:23000"
trailsdk INF - Connecting to dev host at ws://127.0.0.1:23000/play/7qq9QsqNHj...
trailsdk INF - Connected to dev host
trailsdk INF - Initialization successful

The Editor Companion will also tell you if the initialization was successful.

593593

📘

Trail SDK initialization

The Trail SDK is automatically initialized when your game starts up. However, if you would rather have more precise control of when the SDK initializes, you can also disable the automatic initialization and explicitly call the Init method whenever it makes sense for your game.

To disable the SDK automatic initialization uncheck the Initialize SDK At Startup option in the Assets/Trail/Resources/TrailConfig.asset

Excellent! You're all set up 👌 Now it's time to make a build →.


What’s Next