Skip to main content
The Block Selector is a wireframe cursor that highlights the current position in the 3D block grid. It provides visual feedback for block placement, selection, and manipulation.

Grid Navigation

The selector moves on integer grid coordinates (X, Y, Z): The selector position is displayed in the HUD as [X, Y, Z].

Selection Modes

No Selection

The selector shows the current grid position. No faces are highlighted.

Side Selected

One face of the selector is highlighted. This means a specific block side is selected for element placement.
  • Achieved by left-clicking on a block face
  • The raycast detects which face was clicked
  • Only sides belonging to the current section can be selected

Block Selected (Grabbed)

All six faces are highlighted. The block at this position is “grabbed” and can be moved.
  • Achieved by pressing Space on an existing block
  • Press Space again to ungrab
  • Moving the selector with WASD/EQ moves the grabbed block

Visual Feedback

The selector uses material properties to show selection state:
  • Each face has a _Selected shader property (0 or 1)
  • Selected faces render with a distinct color
  • The visual updates every frame in UpdateSelectionColors()

Block Movement

When a block is grabbed:
  1. The selector and block move together
  2. The editor checks if the destination is empty
  3. If occupied, the movement is blocked
  4. On successful move, the block is translated in the block network
  5. All attached balls and enemies are repositioned
  6. Illumination is recomputed

Slot Position

The selector’s position is a BlockSlot — a struct containing integer (X, Y, Z) coordinates. The position is converted to world space using BlockSlot.Position for rendering.

Persistence

The selector position is saved between sessions:
  • Stored in EditorPersistentState.BlockSelectorPosition
  • Restored when the editor loads
  • Default position: (0, 0, 0)