Models in the scene
Placing a 3D model, choosing its animation, using it as the player, adding textures and recorded sounds, and checking the package limits and the credits in editor 0.4.0.
DescribesEditor 0.4.0 For creating without programming
On this page
Since editor 0.4.0 a game can have 3D models, image textures and recorded sounds. Models are made in the asset workshop or brought in with the importer. This page explains how they are used once they are in the project.
Placing a model#
The project's models are in Place pieces, in the Project models category. Each card carries the model's name and, in the corner, how many clips it has.
- Click the model's card, or drag it to the viewport.
- Click where you want it, or drop it there.
The model comes in at its natural size: the one the file has, where one unit is one world unit and the game character is 1.8 tall. It is moved, rotated and resized like any piece. Back to natural size, in Details, undoes the size changes.
If there are no models yet, the category says so: "No models yet. Import them (glb, fbx, obj…) or make them in the workshop", with the Import… button.
Details of a model#
With a piece with a model selected, Details has the Model category:
| Field | What it is |
|---|---|
| Project model | Which of the models the piece shows. |
| Animation (clip shown while playing) | The clip that repeats during the match, with its length. None: at rest leaves it still. |
| Triangles, bones and natural size | What the model weighs for the engine. |
| Back to natural size | Brings the piece back to the model's measures. |
Below, a note reminds you that from code you use pieza.reproducir(clip), pieza.pararAnimacion() and pieza.clips.
The Material color is not used on a model: the model brings its own materials and textures, and Details says so.
The animation is only drawing: it does not move the piece or change how it collides. A model collides as its box, as a capsule, as a close-fitting shape or not at all, depending on what was chosen when it was imported; never against the whole mesh.
The player with a model#
In Details, with nothing selected, the Player look category has Player model in this scene. The usual one (no model) keeps the game's avatar.
A player model is drawn at the avatar's height and only uses four clips: quieto, caminar, saltar and caer. Details says which of those the chosen model has. How the player collides does not change.
Textures on pieces#
A project texture is put on any piece in Details › Material:
- Texture (project image): which one.
- Repeat: how many times it repeats along the piece.
- Pixelated: the pixels look sharp, without smoothing.
- Draw: opens the texture in the pixel editor.
Recorded sounds in the rules#
Recorded sounds show up in the play sound action of the rules, after the twelve synthesized ones and marked (recorded). The rule writes sonido.muestra('…') in the script's rules block.
In Blocks mode, the play recorded sound block shows up when the game has recorded sounds. See Asset workshop.
In the Content browser#
The Models, Textures and Recorded sounds filters show the project's. A model card says how much it weighs, how many triangles it has and in how many places it is used; one that is not used carries unused.
Deleting something that is used warns you first. The card's × says where it is used and that its pieces are deleted too, and offers Delete anyway. It can be undone.
Package limits#
The Game card has the Package limits section. Each measure has its bar against the maximum:
| Measure | Maximum |
|---|---|
| Models | 64 |
| Loose textures | 64 |
| Recorded sounds | 32 |
| Size of models, textures and sounds | 12 MB |
.ggx compressed | 5 MB |
.ggx uncompressed | 20 MB |
| Model triangles, per scene | 150,000 |
| Model pieces, per scene | 300 |
Below, a table with each model: size, triangles, bones, textures, clips and how many copies there are. These are the engine's limits so the game also runs on computers without a graphics card. The Export dialog repeats the limits.
If something goes over its maximum, the bar turns red with its code, the problem shows up in Problems with a plain-words title and Take me there, and the game is not exported until you fix it.
Credits#
Every model, texture and sound has a credit with its author and its license, in creditos.json. What was imported carries what you typed in the importer; what was made in the workshop, your author name and the license propia (your own).
The Game card lists them under Credits of imported assets. They travel inside the .ggx, but the game does not show them on screen yet: if a license asks you to credit the author, credit them in the game's description too.
Exporting#
Export does the usual (validate, the bot plays, write the .ggx) and also shows the Package limits. The .ggx carries the models, textures, sounds and credits. Before exporting, the editor exports what changed in the workshop.
If saving fails#
If the editor cannot save, for example because the project folder has no write permission, a notice appears with Retry, and what you did stays open. The editor does not let you close the project without asking.
Next#
- Asset workshop: making models, textures and maps.
- Import assets: bringing them from other tools.
- Models, textures and sounds: the same from code.