Interactive example running in a local scene
This simple example shows a scene that you can interact with by opening and closing a door. Clicking the door creates an event, which changes the scene's state. The scene's state then changes the rotation of the door, which rotates smoothly thanks to a transition.
Install the CLI
Download and install the Decentraland CLI by running the following commands:
npm i -g decentraland # install decentraland CLI npm install # install local dependencies
For a more details, follow the steps in the Installation guide.
After your CLI is installed, you're ready to preview the scene locally.
Previewing the scene
from the scene directory:
$: dcl preview
Any dependencies are installed and then the CLI will open the scene in a new browser tab automatically.
The scene runs in a WebWorker, inside the user's computer.
The entire code is inside the file scene.tsx.
The large, white dot in the center of the viewport determines which object you're currently focused on. To open or close the door, walk over to it, target it with the white dot, and click.