Content Creators
Quick start

Quick start

The Decentraland SDK is a powerful tool that lets you create scenes by writing in Typescript (Javascript + Types).

This mini-tutorial walks you through how to get set up, and shows you the basic parts of a Decentraland scene.

Install the CLI #

The Command Line Interface (CLI) allows you to compile and preview your scene locally. After testing your scene locally, you can use the CLI to upload your content to Decentraland.

📔 Note : Install the following dependencies before you install the CLI:

To install the CLI, run the following command in your command line tool of choice:

npm install -g decentraland
💡 Tip: If you don’t know how to open the command line, in Windows: right click on the Start button, then search for “cmd” and select the “Command Prompt”. In Mac: open the Launchpad and look for “Terminal”.

Read Installation guide for more details about installing the CLI.

Clone a template scene #

Clone the following template scene to your local machine. Click the Use this template button, then select create a new repository to clone it.

sdk7-scene-template

This project includes all the necessary files to run a Decentraland scene locally, and includes some basic functionality already working.

Preview the 3D scene in your browser by running the following command in that same folder:

dcl start

Read more about the scene preview in preview a scene

Edit the scene #

Open the src/index.ts file from your scene folder with the source code editor of your choice.

💡 Tip: We recommend using a source code editor like Visual Studio Code or Atom. An editor like this helps you by marking syntax errors, autocompleting while you write and even showing smart suggestions that depend on context. Also click on an object to see the full definition of its class.

Change anything you want from this code, for example change the x position of the first cube entity that’s spawned (on line 22). If you kept the preview running in a browser tab, you should now see the changes show in the preview.

Download this 3D model of an avocado from the scene’s GitHub repo in glTF format. link.

Create a new folder under your scene’s directory named /models. Extract the downloaded file and place all of its contents in that folder. Note that there are several files that make up the 3D model, all of them must be in the same path.

At the end of your scene’s index.ts file, add the following lines:

let avocado = engine.addEntity()

GltfContainer.create(avocado, {src: ("models/avocado.gltf"})

Transform.create(avocado, {
	  position:  Vector3.create(3, 1, 3),
	  scale: Vector3.create(10, 10, 10)
	})

Check your scene preview once again to see that the 3D model is now there too.

The lines you just added create a new entity, give it a shape based on the 3D model you downloaded, and set its position and scale.

Note that the cubes in your scene all rotate smoothly, but not the avocado you just added. That’s because a system named circularSystem that comes defined in this template in the systems.ts file is running. This system runs a function on every frame (30 times a second). This system in particular tells every entity that has both a MeshRenderer and a Transform component in the scene to rotate just a tiny bit, once per frame. Your avocado model doesn’t have a MeshRenderer comopnent, so it’s not affected by this system. If you delete or comment out the code for this system, all entities stop rotating.

More Tutorials #

Read coding-scenes for a high-level understanding of how Decentraland scenes function.

For examples that are built with SDK7, check out the Goerli plaza repository that contains several small scenes, all written with SDK7.

See the Development guide section for more instructions about adding content to your scene.

Engage with other developers #

Visit Discord, join a lively discussion about what’s possible and how!

To debug any issues, we encourage that you to check the Troubleshooting and debug sections in the documentation. If you don’t find a solution there, you can post issues to the SDK Support category Decentraland Forum.

You can also post to Stack Overflow, using the tags decentraland or decentraland-ecs.

You can also ask in Discord. In the Support section, the #sdk channel is for questions regarding code, the #builder-and-3d channel is for questions regarding 3D models and art. #code-contribution is for discussing PRs to the SDK codebase.

3D Art Assets #

A good experience will have great 3D art to go with it. If you’re keen on creating those 3D models yourself, you’re encouraged to, see the 3D Modeling section of our docs for more info. But if you prefer to focus on the coding or game design side of things, you don’t need to create your own assets!

Here are a few tips to get great 3D models that you can use in a Decentraland scene:

📔 Note: Models must be in the supported .gltf or .glb formats, and must have a number of triangles, textures and materials that adhere to the scene limitations. If getting models from a third party site, pay attention to the licence restrictions that the content you download has.

Publish your scene #

If you own LAND, or have permissions given by someone that does, you can upload your scene to Decentraland. See publishing.

If you don’t own land, you can still upload your scene for free to third party services, so you can easily share your creations with others as a link. See Deploy to third party.

Other useful information #