LogicBlock 2 – Reusable Logic for Visual ScriptThe same instructions end up in Event after Event: deal damage, open a door, play a hit effect. When something changes, you hunt down every copy and fix them one by one.LogicBlock 2 turns Visual Script instruction lists and conditions into reusable assets. Put your logic in a Block, run it from any Event, and pass in values just like calling a function. Edit a Block once and every place that uses it updates automatically.Built specifically for Visual Script, it uses the same lists, windows, notes, and icons, keeping the workflow you're already familiar with.🧱 Three Block AssetsCreate them from Create > Visual Script > LogicBlock:Instruction Block: One instruction list for a single reusable action, such as Deal Damage, Open Door, or Spawn Loot.Condition Block: One condition list for a reusable check, such as Can Attack? or Has Key?, using All (And) or Any (Or).LogicBlock: Any number of named instruction and condition lists in one asset, ideal for grouping a whole system like enemy behavior (Patrol, Chase, Attack, Flee).🎛️ Parameters, Like a FunctionGive a Block typed inputs with default values so one Block adapts to different callers.Built-In Types: Number, Integer, String, Bool, Color, Vector 2, Vector 3, Quaternion, Game Object, Material, Sprite, Texture, Audio Resource, Animation Clip, Scene, Scriptable Object, and more.Your Own Types: Visual Script Get values appear automatically in Add Parameter... with automatic code generation.Third-Party Modules: Get values from other packages work automatically once installed.Read Anywhere Inside the Block: Pick Parameters > Block Parameter in compatible fields, filtered automatically to types the field can read.🔁 Prefab-Style OverridesEach Run Block or Check Block exposes one field per parameter with prefab-style override behavior:Follows the Block: Unchanged fields inherit the Block's default and keep tracking changes to it.Changed in This Call: Overridden fields are highlighted with a blue bar and bold label.Revert: Right-click any overridden field and choose Revert to Block Default (or set it back to match the default).▶️ Run, Check, and StopEverything you need to use Blocks from any Event:Run Block: Run an Instruction Block or LogicBlock list, either waiting for completion or running independently.Check Block: Evaluate a Condition Block or list as a condition, or as a Bool value to drive any Bool field.Stop Block: Stop active calls for a specific Source or stop All Calls.Is Block Running: True while a Block or list has an active call, great for run-once guards and toggles.⚙️ Runs Anywhere, All at OnceBlocks run as isolated instances with pooled copies, safe nesting, and Play Mode edits.Separate Runs: Every call runs independently with its own Source, Target, and parameter values, even across dozens of enemies at once.Pooled Copies: Reuses pooled list copies after initial calls to avoid unnecessary allocations during gameplay.Safe Nesting: Blocks can call other Blocks without overwriting caller parameters, with a 32-level depth guard against accidental recursion.Play Mode Friendly: Edits made to Block assets in Play Mode apply to the next call and persist afterward.📋 Named Lists in a LogicBlockGroup Instructions and Conditions lists inside one asset with custom notes, icons, and fast lazy loading.Add List: Create Instructions or Conditions lists using Visual Script's standard selector window.Rename, Notes & Clipboard: Right-click any list to rename, edit notes, copy, paste, or duplicate.Custom Icons: List note icons and colors carry over to the inspector and Run Block's list picker.Fast to Open: List contents are built lazily when expanded, keeping large LogicBlocks snappy to open.🪄 Move Instructions to BlockConvert existing Event instructions into a Block in one step via Move Instructions to Block... on an Event component:New Block or New List: Output to a new Instruction Block or a new list inside an existing LogicBlock (with full Undo support).Smart Parameters: Scene object references become parameters automatically, and you can tick any other value to promote it to a parameter.Repeated Values Merged: Identical values used across multiple instructions consolidate into a single parameter.💻 Scripting APIRun, check, and stop Blocks from C#, and embed Call and Arguments fields in your own components with prefab-style overrides intact.🎮 Example ScenesFour sample scenes (using URP materials) with on-scene notes showing key workflows:1 Run Block: Three cubes sharing one Pop Instruction Block.2 Parameters: Set Lamp called with different Color and Intensity overrides alongside default values.3 Check Block: Using Is Lamp On inside an If condition to toggle a lamp and gate popping.4 LogicBlock Lists: A Lamp Show LogicBlock (Red, Blue, Pulse, Reset) paired with Is Block Running and Stop Block.📦 What's IncludedFull Source Code4 Example ScenesDocumentation🔗 Links🌐 Website | 📖 Documentation | 📚 Setup Guide | 💬 Discord






