❗Warning: This is a legacy page covering functionality with the old SDK version 6. See the latest version of this topic here . Each component group keeps track of a list of entities that have all the required components .
The engine automatically updates this list every time that:
A new entity is added to the engine An entity is removed from the engine An entity in the engine adds a new component An entity in the engine removes a component 📔 Note: Only entities that are added to the engine are eligible for component groups.
...
You can query components with the method engine.getEntitiesWith(...components) to keep track of all entities in the scene that have certain components.
Systems typically iterate over the entities in these queries, performing the same operations on each. Having a predefined group of valid entities is a great way to save resources, specially for functions that run on every tick of the game loop. If on every tick your system would have to iterate over every single entity in the scene looking for the ones it needs, that would be very inefficient.
...
December 16, 2024
The transactions-server is a proxy server that relays transactions to Gelato . It receives a signed transaction from the client that it’s in turn sent to the appropiate network behind the scenes. This allows the server’s owner to facilitate it’s users with costless transactions
The transaction server is used to help with the UX of using multiple networks and to prevent them from switching network providers on the fly. The users can stay connected to Ethereum and interact with Polygon by only signing transactions The Decentraland DAO has set up a server used by our dapps, covering the cost up to a certain limit with a few restrictions .
...
September 9, 2024
As a creator, you can have full control over the player’s camera. By default, players are free to chose between a 1st or 3rd person camera mode while exploring your scene, but you can impose a different camera modality.
Virtual cameras can be static, they can rotate to always look at the player or some other entity, or they can be attached to the player or some other entity so that they’re always accompanying.
...
June 19, 2023
Get Decentraland Time # Decentraland follows a day/night cycle that takes 2 hours to be completed, so there are 12 full cycles every day. Players can also change the settings to experience a specific fixed time of day, for example to always see Decentraland with a 10pm night sky. For this reason, Decentraland time may vary from one player to another.
Use getWorldTime() to fetch the time of day that the player is experiencing inside Decentraland.
...
February 27, 2018
Raycasting is a fundamental tool in game development. With raycasting, you can trace an imaginary line in space, and query if any entities are intersected by that line. This is useful for calculating lines of sight, trajectories of bullets, pathfinding algorithms and many other applications.
When a player pushes the pointer button, or the primary or secondary button, a ray is traced from the player’s position in the direction they are looking, see button events for more details about this.
...
February 22, 2018
❗Warning: This is a legacy page covering functionality with the old SDK version 6. See the latest version of this topic here . Track player position and rotation # The Camera object exposes information about the player’s point of view in your scene.
Camera.instance.position returns a 3D vector with the coordinates of the avatar’s center, relative to the scene. When the player is on the ground, the height of this point is approximately 1.
...
February 22, 2018
Player position and rotation # Use the PlayerEntity and the CameraEntity to know the player’s position and rotation, by checking their Transform components.
function getPlayerPosition() { if (!Transform.has(engine.PlayerEntity)) return if (!Transform.has(engine.CameraEntity)) return //player position const playerPos = Transform.get(engine.PlayerEntity).position //player rotation const playerRot = Transform.get(engine.PlayerEntity).rotation //camera position const CameraPos = Transform.get(engine.CameraEntity).position //camera rotation const CameraRot = Transform.get(engine.CameraEntity).rotation console.log('playerPos: ', playerPos) console.log('playerRot: ', playerRot) console.log('cameraPos: ', CameraPos) console.log('cameraRot: ', CameraRot) } engine.
...
February 13, 2018
3D models in .glTF and .glb format can include as many animations as you want in them. Animations tell the mesh how to move, by specifying a series of keyframes that are laid out over time, the mesh then blends from one pose to the other to simulate continuous movement.
Most 3D model animations are skeletal animations . These animations simplify the complex geometry of the model into a “stick figure”, linking every vertex in the mesh to the closest bone in the skeleton.
...
February 13, 2018
❗Warning: This is a legacy page covering functionality with the old SDK version 6. See the latest version of this topic here . 3D models in .glTF and .glb format can include as many animations as you want in them. Animations tell the mesh how to move, by specifying a series of keyframes that are laid out over time, the mesh then blends from one pose to the other to simulate continuous movement.
...