Block

July 4, 2022

Block

Note: Blocks are only available in block projects, if you don’;t find the function mentioned below, please check if your project is a block project.

In the block project, blocks are the most commonly used Part to build scenes. You can learn how to use blocks to build scenes and terrains through the Using Blocks chapter.

In addition to using the built-in block templates in the editor, you can also modify the built-in block templates or create completely new block templates.

Click below the Game Part panel New button, you can create a new block template. The newly created block does not have properties such as preview icon and texture. You need to configure its properties in the property panel of the block.

Block template: The block template specifies the Property of the block, including block texture, collision volume, etc.
All the blocks placed in the scene are generated based on the block template, so when modifying the block template,  will modify all the blocks created based on this template in the scene at the same time.

Basic properties

Property Function
block name The name of the block template, the name Display name for blocks only, when calling a block through code, etc., you need to use the block’s id (right-click on the block template and select ”copy id”; to get the block’s id).
block map A regular block is a cube consisting of 6 faces. This property can be used to set the texture of each face of the block (for blocks whose shape is not a cube, it is not supported to modify the texture of this block in the editor).
opaque block If the block uses The texture has a transparent channel, you need to uncheck this property, otherwise it may cause the block to be rendered incorrectly.
Dropped after death Sets whether the block will automatically drop into the scene when the player dies if there is a block in the player’;s backpack.

physical properties

Property Function
collider The collider determines the range in which the block collides with other objects, including the detection range when the block is clicked.

Usually the block is a 1 * 1 * 1 cube, and the collision body is set to (0,0,0)~(1,1,1).

If you want the blocks not to collide (for example, making blocks that can swim inside blocks, blocks that can be climbed, etc.), you need to delete all colliders (even if the collider is set to 0, the collision logic will still take effect, so need to be removed).

block elasticity When the elasticity of the block is greater than 0, when the Entity falls on the block, it will be bounced off by the elastic force.
Blocks can fall automatically Sets whether the upper block will fall automatically if the lower block is broken when two blocks are stacked together.
Entity drop speed refer to Entity The speed of falling inside the block (eg: the player’s falling speed in a water block).

Block interaction properties

Property Function
Blocks are clickable When the block is set to be clickable, the click event can only be triggered when the block is clicked.
Click on the convert box After the block is clicked, it will be converted to the specified block.
Blocks can be broken Set in the game, whether the player can smash the block by long-pressing the block.
Time spent breaking blocks Sets the time it takes for the player to break blocks (i.e. how long it takes for a long press to break a block).
Drops itself when broken Can drop itself: Sets whether the block drops that can be picked up in place after the block is broken. After the player picks up this drop, the corresponding block will be automatically added to the backpack.

Block drop quantity: Set how many blocks will be added to the backpack after breaking a block and picking up its drops.

Drops Item after being smashed Can drop itself: After the block is smashed, whether to drop items that can be picked up in place. After the player picks up the drop, the corresponding item will be automatically added to the backpack.

Click the + sign on the right side of the property to add the type of Item dropped and the number of dropped items.

Blocks can be regenerated When checked, blocks can be regenerated in place after being broken.
block respawn time Sets the number of seconds between blocks that will respawn after being smashed.
buff when the Entity is on a block Sets the buff that the Entity will automatically get when it is on the top surface of the block.
buff when the Entity is inside a block Sets the buff that the Entity will automatically get when it is inside a block.
The buff when the Entity jumps on the block Set the buff that the Entity will automatically get when it jumps on the top surface of the block.
buff when Entitys run on blocks Set the buff that the Entity will automatically get when running on the top surface of the block.
The buff when the Entity sprints on the block Set the buff that the Entity will automatically get when sprinting on the top surface of the block.
Sound when placing blocks The sound effect played when the player places a block, you can customize the audio, set whether it is only audible to you, whether to loop and set the volume.
Sound when breaking blocks The sound effect played when the player breaks blocks, you can customize the audio, set whether it can only be heard by yourself, whether to loop and set the volume.

special block properties

Property Function
climbing speed The climbing speed at which the Entity climbs this block. Note:Blocks can only be climbed if they have no colliders see the Physical Properties of the block.
Cubes can swim Sets whether Entitys can swim in blocks. Note:Entitys can only swim in the block if the block has no colliders see the Physical Properties of the block.
Maximum movement speed in the block Sets the maximum movement speed of the Entity in the block, and the swimming speed is also limited by this speed.

Edit Events

Property Function
Edit Events Edit Trigger Use visual programming to edit the event logic of the block, see Block Trigger Editing for details.