Scripting / Instructions
PlayerInstruction
Abstract marker class. Extend this to create any action the player can place in the instruction sheet. Inherits the full API of Instruction.
Instruction
└── PlayerInstruction ← you are here
├── Instruction_Move / Jump / Attack / …
├── InstructionModifier
└── InstructionSequence
Purpose
PlayerInstruction adds no new members — it exists as a type boundary that separates player actions from enemy actions. The instruction sheet, InstructionRunner, and all container classes work with PlayerInstruction references, not the broader Instruction type.
When to Extend
| Goal | Extend |
|---|---|
| A single standalone action (Move, Attack, custom ability) | PlayerInstruction |
| An action that wraps and modifies one child instruction | InstructionModifier |
| An action that holds and runs multiple child instructions | InstructionSequence |
| An enemy AI action | EnemyInstruction |
Minimal Implementation
using System.Collections; namespace LoopAdventure { [TypeName("MyAction")] public class Instruction_MyAction : PlayerInstruction { public override string displayName => "My Action"; public override void Execute() { } protected override IEnumerator Tick(ExecutionContext ctx) { // your logic here yield break; } } }
Full guide
See Create an Instruction in the Manual for the complete workflow including prefab setup and palette registration.