Overview

The instruction sheet displays each instruction as a draggable widget — that widget is an InstructionLayout prefab. Each palette item GameObject also carries an Action component that binds the widget to a specific instruction C# class and supplies the prefab that the sheet instantiates when the player places the instruction.

You never create a layout prefab from scratch. Instead, duplicate any built-in prefab from Assets/Prefabs/Player Instructions/ and adapt it. Every built-in prefab already has the correct two-level structure and all required references set up.

Step 1 — Duplicate a prefab

In the Project window, navigate to Assets/Prefabs/Player Instructions/. Right-click any built-in instruction prefab and choose Duplicate. Rename it to match your new instruction (e.g. Instruction_Teleport.prefab).

Every instruction prefab has two GameObjects:

Step 2 — Choose the right layout type

The child GameObject must carry the layout component that matches your instruction's base class. If the duplicated prefab already uses the right component, skip ahead. Otherwise remove the existing layout component and add the correct one.

Instruction base classRequired layout component
PlayerInstructionInstructionLayout
InstructionModifierInstructionModifierLayout
InstructionSequenceInstructionSequenceLayout
Instruction_UseInstructionUseLayout

Step 3 — Configure InstructionLayout

Select the child GameObject and fill in the InstructionLayout Inspector fields. The essential ones are:

FieldWhat to set
iconThe instruction's icon sprite — displayed on the widget in the sheet.
nameTextThe TMP_Text label that shows the instruction's display name at runtime.
showDirectionButtonsEnable if your instruction reads the direction field. Disable for instructions that ignore direction.
showLoopCountEnable to expose the loop counter badge on the widget.
backgroundsArray of background images — the runner highlights the active index each turn to show execution progress.

Step 4 — Extra wiring for special layout types

Modifier, Sequence, and Use layouts require additional references on top of the base InstructionLayout fields.

Layout typeExtra setup
InstructionModifierLayoutSet actionDropEventCaller to the DropActionEventCaller component on the child slot — the area where the player drops another instruction to fill the modifier.
InstructionSequenceLayoutSet childContainer to the Transform that will parent the spawned child layout widgets when instructions are placed inside the sequence.
InstructionUseLayoutWire openInventoryButton to the Button that opens the item picker so the player can assign an item to the slot.

Step 5 — Wire the Action component

Select the root GameObject of the prefab and set the Action component fields:

The Action component uses both references together: instructionType to create the data object and layout to spawn the corresponding visual widget.

Step 6 — Add to the palette

Drag the prefab into the palette panel in your scene (a child of the Player Canvas). Each palette item must have a DragAndDrop component — without it the player cannot drag the instruction onto the sheet.

Once placed, the instruction appears in the palette and the player can drag it to the instruction sheet during gameplay.

ℹ️
See Instruction Layouts for the full property and method reference for each layout component type, and Action for the API of the root palette component.