๐ถPlayCanvas
PlayCanvas is a WebGL Engine with a built in editor UI, allowing you to build interactive 3D scenes with an intuitive interface and high quality graphics.
Last updated
PlayCanvas is a WebGL Engine with a built in editor UI, allowing you to build interactive 3D scenes with an intuitive interface and high quality graphics.
Last updated
We recommend Chrome, or another Chromium based browser for best performance.
If you're totally new to PlayCanvas, you'll need to setup a new project. You can do this by going to PlayCanvas.com and creating an account. Once you've logged in you should see a getting started screen like this one:
In order to add Looking Glass WebXR Support to the PlayCanvas editor you'll need to follow the steps below:
In the PlayCanvas Editor, navigate to the scripts directory, then right click and choose New Asset -> Script
In order to properly load the Looking Glass WebXR Library with PlayCanvas we need to change the order in which the script executes.
Select the script asset, and then in the right panel, choose Before Engine
in the Loading Type
drop down.
You must choose the Before Engine
option in order for the script to load properly.
Double click the script asset you've created, and paste the following code into the editor once it opens up. Syntax is important here so we highly recommend copying directly from this code block.
Make sure to save your script before returning to the editor.
After you've added the script we now need to initialize the WebXR Session, you can do this in your main script or another script, the location doesn't matter as long as it is in a different location than the initialization code above, and the script is set to load as an Asset
In this case, we've named the script main.js
however, you can use whatever name you wish.
After creating the script, you need to reference it in your scene. In this case we're going to add it to the root/scene component. This is the entity that's the at the top level of the scene structure.
Once you've added this script, click the Play button and you should see a small "Looking Glass" button in the scene.
Once you click the button, you should see a prompt to open a window, choose yes, the window should then automatically open on your screen if you're using Chrome. If you're using another browser, like Firefox, you'll need to manually move the window over to the device.