Blockly

To open the visual scene logic editor, go to the project page and click on the puzzle icon next to the scene

The following window will open where:

  1. Workspace
  2. Block Library
  3. Blockly toolbar

Workspace

A logical structure of the scene - a script - is created in the workspace

Navigation in the editor

To see all the available keyboard shortcuts, in the Logic Editor mode, in the lower left corner of the screen, click the question mark icon with the left mouse button:

The Blockly editor supports the use of keyboard shortcuts:

ActionKeyboard Shortcut
Shortcuts in Blockly
SaveCtrl + S
SearchCtrl + F
Select all blocksCtrl + A
Duplicate blockCtrl + D
Cut BlockCtrl + X
Copy BlockCtrl + C
Paste BlockCtrl + V
ZoomMMB up
MoveMMB down
Create new tabCtrl + T
Fast to change tabCtrl + 1...9
Delete a blockDel / Backspace
Undo the previous actionCtrl + Z
Redo the previous actionCtrl + Shift+ Z
Turn on/turn of fullscreen mode F11

Workspace controls

In order:

  1. Expand editor to full screen
  2. Focus on the center of the work area. The center is determined by existing blocks
  3. Zoom in on workspace
  4. Zoom Out Workspace
  5. Trash from which you can restore recently deleted blocks and groups of blocks

Search by objects

In the logic editor, there is a search for blocks by objects in the workspace located on the stage. To call it, you must press the key combination Ctrl + F

  • Jump to the previous search result
  • Move to the next search result
  • Case-sensitive search - search results become dependent on the input of upper or lower case characters

For example, if you want to find “block 1” and in the search write “Block 1” using case sensitivity, then you will not find “block 1”

  • Search by words - the search occurs only for the entered words

For example, if you want to search for “Player” and start spelling the word, the result will not be shown until the word is entered completely

  • Close search box


Block context menu

Right-clicking on a block opens the context menu of the block, allowing you to:

  • Duplicate Block
  • Add a comment to a block
  • Insert inside/outside


This function changes only the visual display of the block

  • Collapse/expand block
  • Disable block
  • Delete block or group of blocks

Block Library

The script is assembled from the blocks in the block library. All blocks are grouped into sections according to their purpose: “Logic”, “Actions”, etc.

For objects located on the stage, in the “Objects” section, subsections are created according to the type of objects

You can read more about block types in the corresponding article

Block search

Blocks are searched at the top of the block library. The search works for the names of blocks and objects from the scene

 

Blockly toolbar

The toolbar allows:

  1. Apply Changes
  2. Cancel changes
  3. Switch to VR Scene Preview
  4. Switch to scene preview on PC
  5. Go to scene edit mode on PC
  6. Open code (recommended for experienced programmer users)

Highlighting blocks in use

For the convenience of the user, a function was developed to highlight active blocks that are currently being executed in the project. This is useful for debugging and identifying errors in a script

In this example, two blocks are selected at once:

  • An event block that reacts to the collision of objects on the stage. This happens because when the scene starts, we animate the cube by moving it to the side where the sphere is. Therefore, it turns out that at the moment the cube collides with another object, this block is triggered
  • An event block that includes a construction of action blocks on three objects: a cone, a cube, and a sphere

Working with logic of deleted object

When deleting an object from the 3D scene, the user will see a message stating that this “Object is used in logic. Do you want to delete it?”

If you delete such an object, then all the logic associated with this object will stop working and the blocks of this object will become inactive

However, if you place a new object of the same type as the old one and name it the same, all related logic is reanimated and will work correctly