Guide HubCentro de guías
Setting up a scene · Godot foundationsPreparar una escena · Fundamentos de Godot

Godot · scenesGodot · escenas

Setting up a new scene from scratch.Preparar una escena nueva desde cero.

Not sure where to start? A great place to begin is by making a new to use as a simple playable area. Add some ground tiles, bring in a player, and you already have a space where you can start testing ideas.¿No sabes por dónde empezar? Un buen punto de partida es hacer una nueva para usarla como una simple área jugable. Añade algunas tiles de suelo, mete un jugador, y ya tienes un espacio donde puedes empezar a probar ideas.

This is also a common way to start building with the StoryQuest Kit. You can create a new scene, bring in ground, a player, and other pieces that already exist in Threadbare, then build your own ideas on top of them. A scene can be something big, like the playable area you’ll make here, or something small, like a character, tree, or collectible, so you can reuse those smaller pieces instead of rebuilding everything yourself.Esta también es una forma común de empezar a construir con el StoryQuest Kit. Puedes crear una escena nueva, traer suelo, un jugador y otras piezas que ya existen en Threadbare, y luego construir tus propias ideas sobre ellas. Una escena puede ser algo grande, como el área jugable que harás aquí, o algo pequeño, como un personaje, un árbol o un coleccionable, así que puedes reutilizar esas piezas más pequeñas en lugar de reconstruir todo tú mismo.

StartInicioAn empty sceneUna escena vacía
GoalMetaA simple play areaUn área jugable simple

Words with a colored underline open a short explainer. Click any of them to learn more.Las palabras con subrayado de color abren una breve explicación. Haz clic en cualquiera para saber más.

Make an empty scene and give it a root node.Crea una escena vacía y dale un nodo raíz.

Every scene is a small tree of , and it always starts the same way: one node at the top, with everything else added underneath it. That top node is the . Before you add anything or bring anything in, let's make that root node and save the file.Cada escena es un pequeño árbol de , y siempre empieza igual: un nodo arriba, con todo lo demás debajo. Ese nodo de arriba es la . Antes de añadir o traer nada, creamos ese nodo raíz y guardamos el archivo.

Godot's Create Root Node panel, shown when a new scene is still empty.

starting pointpunto de partida

A built scene shown as a tree of nodes: a root node at the top with everything else nested beneath it.

example finished sceneejemplo de escena terminada

Every new scene starts blank. You pick a root node (left image), and you add components as needed until it is a tree of nodes, with everything nested under that initial root node (TeleporterTest1 is the root node on the example finished scene on the right).Cada escena nueva empieza vacía. Eliges un nodo raíz (imagen de la izquierda) y vas añadiendo componentes según necesites hasta que es un árbol de nodos, con todo anidado bajo ese nodo raíz inicial (TeleporterTest1 es el nodo raíz en la escena de ejemplo terminada de la derecha).
Steps 1–4Pasos 1–4

click a number when you've done that stephaz clic en un número cuando termines ese paso

Open a project in Godot.Abre un proyecto en Godot.

Open Godot and load a project. You'll land in the editor with whatever scene was last open.Abre Godot y carga un proyecto. Entrarás al editor con la última escena que estuvo abierta.

Make a new, empty scene.Crea una escena nueva y vacía.

Click the next to the scene tabs, along the very top of the viewport. This is the same row your open scenes sit in. That opens a fresh, empty scene in its own tab. You can have many scene tabs open at once while you work, and you can switch between them.Haz clic en el junto a las pestañas de escena, arriba del todo del viewport. Esta es la misma fila donde están tus escenas abiertas. Eso abre una escena nueva y vacía en su propia pestaña. Puedes tener muchas pestañas de escena abiertas a la vez mientras trabajas, y puedes cambiar entre ellas.

The top of the Godot editor: the Scene panel on the left and the scene-tab strip on the right, with the plus button that opens a new scene highlighted.

Choose 2D Scene for your root node.Elige 2D Scene para tu nodo raíz.

With the scene empty, the Scene panel shows the Create Root Node menu. Choose 2D Scene. Godot adds a at the top of the Scene tree. This will be the that holds everything else you add to your playable area.Con la escena vacía, el panel Scene muestra el menú Create Root Node. Elige 2D Scene. Godot añade un en la parte de arriba del Scene tree. Este será la que contiene todo lo demás que añadas a tu área jugable.

Godot's Create Root Node menu, with the 2D Scene option highlighted and a cursor pointing at it.
Choose 2D Scene, the first option in the menu.Elige 2D Scene, la primera opción del menú.

Rename the root to PlayArea, and save the scene.Renombra la raíz a PlayArea y guarda la escena.

Double-click Node2D in the Scene panel and rename it PlayArea. Then press Ctrl+S (Cmd+S on Mac) and save it as PlayArea.tscn inside the project. You can also use Scene → Save Scene As… from the top menu.Haz doble clic en Node2D en el panel Scene y renómbralo PlayArea. Luego pulsa Ctrl+S (Cmd+S en Mac) y guárdalo como PlayArea.tscn dentro del proyecto. También puedes usar Scene → Save Scene As… desde el menú superior.

Godot's Scene menu open, with Save Scene As… highlighted.
Top left menu: Scene → Save Scene As…Menú arriba a la izquierda: Scene → Save Scene As…

Use TileMapLayers to build the ground and environment.Usa TileMapLayers para construir el suelo y el entorno.

To turn this empty scene into a playable area, you'll need some ground and an environment for the player to move through. In Threadbare, much of that world is built with . A TileMapLayer lets you paint reusable tiles onto a grid to build part of the ground or environment.Para convertir esta escena vacía en un área jugable, necesitarás algo de suelo y un entorno por el que el jugador pueda moverse. En Threadbare, gran parte de ese mundo se construye con . Una TileMapLayer te deja pintar tiles reutilizables sobre una cuadrícula para construir parte del suelo o el entorno.

Scenes often use several TileMapLayers so different parts of the environment stay separate. You might have ground on one layer, paths or water on another, and other details above or below them. Stacking layers like this helps you build up the environment without everything being painted onto the same layer.Las escenas suelen usar varias TileMapLayers para que las distintas partes del entorno queden separadas. Puedes tener el suelo en una capa, los caminos o el agua en otra, y otros detalles encima o debajo. Apilar capas así te ayuda a construir el entorno sin pintarlo todo en la misma capa.

The fastest option: reuse a TileMapLayerLa opción más rápida: reutilizar una TileMapLayer

You don't always need to build your ground from scratch. Godot lets you copy an already-painted TileMapLayer from one scene and paste it into another, including all the tiles already placed on that layer.No siempre necesitas construir tu suelo desde cero. Godot te deja copiar una TileMapLayer ya pintada de una escena y pegarla en otra, incluidos todos los tiles colocados en esa capa.

This can be a fast way to bring over some ground or part of an environment when you mainly need a basic playable area to test or build something else.Esta puede ser una forma rápida de traer algo de suelo o parte de un entorno cuando lo que necesitas es un área jugable básica para probar o construir otra cosa.

In this guide, we'll also show you how to add and paint your own TileMapLayers so you know how to build or change the environment yourself.En esta guía también te mostraremos cómo añadir y pintar tus propias TileMapLayers para que sepas cómo construir o cambiar el entorno tú mismo.

Steps 5–9Pasos 5–9

click a number when you've done that stephaz clic en un número cuando termines ese paso

Add a TileMapLayer under PlayArea.Añade una TileMapLayer bajo PlayArea.

Select PlayArea in the Scene panel, then click the Add Child Node button. Search for TileMapLayer, select it, and click Create. The new TileMapLayer should appear underneath PlayArea in the Scene tree.Selecciona PlayArea en el panel Scene, luego pulsa el botón Add Child Node. Busca TileMapLayer, selecciónalo y haz clic en Create. La nueva TileMapLayer aparecerá bajo PlayArea en el Scene tree.

Search for TileMapLayer, select it, and click Create.Busca TileMapLayer, selecciónalo y haz clic en Create.
After you add it, TileMapLayer appears underneath PlayArea in the Scene tree.Después de añadirla, TileMapLayer aparece bajo PlayArea en el Scene tree.

Tidy tipOrden — planning a lot of layers? Add another plain Node2D named TileMapLayers first and put the layers under it as children. Think of it like a sub-folder for them, so you can expand or collapse the whole group at once.— ¿vas a tener muchas capas? Añade primero otro Node2D llamado TileMapLayers y pon las capas debajo como hijos. Piénsalo como una subcarpeta para ellas, para expandir o contraer todo el grupo de una vez.

Give the layer a TileSet to paint with.Dale a la capa un TileSet para pintar.

Select the new TileMapLayer and look in the Inspector. Find the property, open its dropdown, and choose Quick Load. Select the exterior_floors TileSet. The layer now has a set of tiles you can paint with.Selecciona la nueva TileMapLayer y mira en el Inspector. Busca la propiedad , abre su desplegable y elige Quick Load. Selecciona el TileSet exterior_floors. La capa ya tiene un conjunto de tiles con los que pintar.

Paint some patches of ground.Pinta parches de suelo.

The TileMap panel opens at the bottom of the editor. Choose a ground tile, select the paint brush, then click and drag in the viewport to paint some ground.El panel TileMap se abre en la parte de abajo del editor. Elige un tile de suelo, selecciona el pincel, y luego haz clic y arrastra en el viewport para pintar algo de suelo.

Godot's TileMap panel: the tile palette on the left and the painting tools along the top, including the paint brush and the eraser.
The TileMap panel with tools across the top. The paint brush is highlighted here; the eraser sits a few tools to its right.El panel TileMap con las herramientas arriba. El pincel está resaltado aquí; el borrador está unas herramientas a la derecha.

Painted in the wrong spot? The eraser is in the same tile toolbar, or press Ctrl+Z to undo the last stroke.¿Pintaste en el lugar equivocado? El borrador está en la misma barra de tiles, o pulsa Ctrl+Z para deshacer el último trazo.

Tip: try when you want to paint an environment more quickly. Instead of choosing every edge and corner tile yourself, you paint the shape you want and Godot chooses matching tiles as you go. This TileSet already has Terrains set up for you.Consejo: prueba cuando quieras pintar un entorno más rápido. En vez de elegir tú mismo cada tile de borde y esquina, pintas la forma que quieres y Godot elige los tiles que encajan sobre la marcha. Este TileSet ya tiene Terrains configurados para ti.

Add a second layer for water underneath your ground.Añade una segunda capa para el agua debajo de tu suelo.

Add another TileMapLayer and give it the Water TileSet. Keeping the water on its own layer lets you place it underneath the ground and other parts of your environment.Añade otra TileMapLayer y dale el TileSet Water. Mantener el agua en su propia capa te permite colocarla debajo del suelo y de otras partes de tu entorno.

The Water TileSet has two versions of the same-looking water tiles. Base Tiles have collision, so the player can't walk through them. Alternative Tiles don't, so they're useful for water underneath a bridge or anywhere else you want the player to still be able to move through the area.El TileSet Water tiene dos versiones de los mismos tiles de agua. Los Base Tiles tienen colisión, así que el jugador no puede atravesarlos. Los Alternative Tiles no, así que sirven para el agua debajo de un puente o en cualquier otro sitio donde quieras que el jugador aún pueda moverse por la zona.

The Water.png tileset open, showing a Base Tiles square and a wider Alternative Tiles block.
Base Tiles block the player. Alternative Tiles look the same, but don't block movement.Los Base Tiles bloquean al jugador. Los Alternative Tiles se ven iguales, pero no bloquean el movimiento.

Name your layers and put them in the order you want.Nombra tus capas y ponlas en el orden que quieras.

Give each TileMapLayer a clear name, like Ground, Paths, or Water. You can also drag layers up or down in the Scene tree to change which ones are drawn in front. Layers lower in the Scene tree are drawn on top of the ones above them.Dale a cada TileMapLayer un nombre claro, como Ground, Paths o Water. También puedes arrastrar las capas hacia arriba o abajo en el Scene tree para cambiar cuáles se dibujan delante. Las capas más abajo en el Scene tree se dibujan encima de las de arriba.

Add a character and a few decorative assets.Añade un personaje y algunos elementos decorativos.

Here's an example of where a bigger scene starts being built from smaller ones. Parts of the game, like characters and decorative objects, can already exist as their own saved scenes. You can bring those scenes into your play area and reuse them instead of building everything again.Aquí tienes un ejemplo de cómo una escena más grande empieza a construirse a partir de otras más pequeñas. Partes del juego, como personajes y objetos decorativos, pueden existir ya como sus propias escenas guardadas. Puedes traer esas escenas a tu play area y reutilizarlas en vez de construir todo de nuevo.

SceneProjectDebug
PlayAreaplayer
Scene
◆PlayArea
◆Grass
◆Paths
Inspector
FileSystemImport
.tscn
player.tscn
tree.tscn
bush.tscn
your pieces live heretus piezas viven aquí
Output
The FileSystem panel, bottom-left, holds every saved scene in the project. Type .tscn in the filter to show just the scenes you can drag in.El panel FileSystem, abajo a la izquierda, guarda cada escena guardada del proyecto. Escribe .tscn en el filtro para mostrar solo las escenas que puedes arrastrar.
Steps 10–11Pasos 10–11

click a number when you've done that stephaz clic en un número cuando termines ese paso

Add a player scene and a Camera2D.Añade una escena de jugador y una Camera2D.

In the FileSystem, find player.tscn, then click and drag it into your PlayArea. You can also open another scene with a player, right-click the player node, copy it, and paste it into yours. Add a as a child of the player so the view follows them.En el FileSystem, busca player.tscn y arrástralo a tu PlayArea. También puedes abrir otra escena con un jugador, haz clic derecho en el nodo del jugador, cópialo y pégalo en la tuya. Añade una como hija del jugador para que la vista lo siga.

Drop a decorative asset from the files a few times.Suelta un elemento decorativo de los archivos varias veces.

Look through the FileSystem for things you can use to decorate your play area. To show only saved scenes, type .tscn in the FileSystem filter. You might find ready-made pieces like bushes, rocks, or other objects that already include things like collision. Drag them into your scene, or copy and paste pieces from another scene. Pick one you want and click and drag it into the viewport. Each time you do this it is another instance of that one saved scene in the FileSystem, so five trees are five copies of a single “template” scene file.Busca en el FileSystem cosas que puedas usar para decorar tu play area. Para mostrar solo escenas guardadas, escribe .tscn en el filtro del FileSystem. Puedes encontrar piezas ya hechas como arbustos, rocas u otros objetos que ya incluyen cosas como colisión. Arrástralas a tu escena, o copia y pega piezas de otra escena. Elige la que quieras y arrástrala al viewport. Cada vez que lo haces es otra instancia de esa única escena guardada en el FileSystem, así que cinco árboles son cinco copias de un solo archivo de escena “plantilla”.

Tidy tipOrden

Organize your SceneTree.Organiza tu SceneTree.

As your scene gets bigger, you can add more Node2Ds just to keep things organized. Rename one for a group, like Trees, Decorations, or Enemies, then move those objects underneath it. Now you can collapse the whole group to keep the Scene dock easier to read. Check out some of the larger scenes in the kit for examples.A medida que tu escena crece, puedes añadir más Node2Ds solo para mantener el orden. Renombra uno para un grupo, como Trees, Decorations o Enemies, y mueve esos objetos debajo. Ahora puedes colapsar todo el grupo para que el panel Scene se lea más fácil. Mira algunas de las escenas más grandes del kit como ejemplo.

Save and run the scene.Guarda y ejecuta la escena.

Step 12Paso 12

click a number when you've done that stephaz clic en un número cuando termines ese paso

Play the scene, and walk around.Ejecuta la escena y camina por ella.

Press F6 to run the scene you have open, or click the Play Scene button in the top-right. Your play area should open with the character ready to move around the space you built. The character can move using the WASD or arrow keys, just like in other scenes.Pulsa F6 para ejecutar la escena que tienes abierta, o haz clic en el botón Play Scene arriba a la derecha. Tu play area debería abrirse con el personaje listo para moverse por el espacio que construiste. El personaje se mueve con las teclas WASD o de flecha, igual que en otras escenas.

Can't see the player?¿No ves al jugador? — if the camera isn't following the character, make sure the Camera2D is a child of the player. If you can see the player but not your TileMaps, the player may be starting far from the area you painted.— si la cámara no sigue al personaje, asegúrate de que la Camera2D sea hija del jugador. Si ves al jugador pero no tus TileMaps, quizá el jugador empieza lejos del área que pintaste.

You can choose where your StoryQuest begins laterPuedes elegir más tarde dónde empieza tu StoryQuest

While you’re building, you can run and test the scene you’re working on. You don’t have to decide yet which scene players will start with.Mientras construyes, puedes ejecutar y probar la escena en la que estás trabajando. Todavía no tienes que decidir con qué escena empezarán los jugadores.

Later, when you know where your StoryQuest should begin, you can set that .tscn file as the Main Scene.Más tarde, cuando sepas dónde debería empezar tu StoryQuest, puedes establecer ese archivo .tscn como la Main Scene.

You should now be able to…Ahora deberías poder…

build a new scene from scratch with a ground, an environment, and a character.crear una escena nueva desde cero con suelo, un entorno y un personaje.

Try it with BackstitchPruébalo con Backstitch

Want to undo something? Backstitch can help.¿Quieres deshacer algo? Backstitch puede ayudarte.

You just saved your scene — a good moment to try Backstitch’s undo before you tackle bigger challenges. Backstitch lets you move between different save points, and it tracks every time you save your scene or game.Acabas de guardar tu escena: un buen momento para probar el deshacer de Backstitch antes de enfrentarte a retos más grandes. Backstitch te permite moverte entre distintos puntos de guardado y registra cada vez que guardas tu escena o tu juego.

  1. Move something in the viewport — drag your character or a decorative object somewhere new — then press Ctrl+S (or Cmd+S on a Mac) to save the change.Mueve algo en la vista 2D — arrastra tu personaje o un objeto decorativo a un lugar nuevo — y pulsa Ctrl+S (o Cmd+S en Mac) para guardar el cambio.
  2. Follow the Undo changes steps in Developing your StoryQuest using Backstitch to Reset to here, and watch it jump back.Sigue los pasos de Deshacer cambios en Desarrollar tu StoryQuest con Backstitch para hacer Reset to here y míralo volver a su sitio.

Try this a few times so it feels familiar — it’ll be your safety net when you build bigger things.Hazlo varias veces para que te resulte familiar: será tu red de seguridad cuando construyas cosas más grandes.

Try it againInténtalo otra vez

The best way to get comfortable with scenes is to make a few. Try starting another new scene, painting a small area, and bringing in different pieces from the kit.La mejor forma de sentirte cómodo con las escenas es hacer unas cuantas. Prueba a empezar otra escena nueva, pintar un área pequeña y traer piezas distintas del kit.

Not everything you reuse will work perfectly right away. Some scenes depend on other nodes, resources, or settings to function. Try things anyway, run your scene often, and see what works, what needs a little setup, and what you can reuse in your own StoryQuest.No todo lo que reutilices funcionará perfecto de inmediato. Algunas escenas dependen de otros nodos, recursos o ajustes para funcionar. Prueba de todos modos, ejecuta tu escena a menudo, y mira qué funciona, qué necesita un poco de configuración y qué puedes reutilizar en tu propio StoryQuest.