⚒️ Getting Started
Before all else, we must install the Pley 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.
Get the Pley SDK Editor Extension for Unity
The Pley SDK Editor Extension is the easiest and fastest way to bring your game to the web. It contains the Pley SDK, a library that enables the entire suite of Pley 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 Pley SDK to your project
1) Import the Asset Package into your project by clicking the downloaded Pley 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 Pley SDK window via the Unity menu: Window > Pley > Pley SDK.
Your firewall might now prompt you. The Editor Extension requires a connection to Pley to function, so make sure you click Allow access.
3) Log in with your Pley developer account.
4) Select your game in the Game dropdown. This lets us know which Pley 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 Pley while playing it in Unity, which in turn will initialize the Pley SDK.
2) With the Editor Companion browser window still opened, enter Play Mode in Unity.
3) With the connection to Pley established via the Editor Companion, the SDK should now initialize.
This may take a few seconds.
4) Open the Unity console. If the Pley 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.
Pley SDK initialization
The Pley 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
Initmethod 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 →.
Updated 24 days ago