LogicBlock 2

Getting Started

Install LogicBlock 2, import the examples, and make your first reusable Block.

Install LogicBlock 2

Install LogicBlock 2 after Visual Script is ready.

  1. Install and set up Visual Script 1.0.4 or newer.
  2. Open Window > Package Manager and install LogicBlock 2.
  3. Wait for Unity to finish compiling. LogicBlock 2 then generates its parameter types.

Requirements and installation

RequirementVersion
Unity6000.5 or newer
Visual Script1.0.4 or newer (works.catsoft.visualscript)
Packageno.fullscreen.logicblock2
NamespaceFullscreen.LogicBlock2.Runtime (and .Editor, .Generated)

LogicBlock 2 is a package. After installing it, it appears in Window > Package Manager as LogicBlock 2, next to Visual Script.

Importing the examples

  1. Open Window > Package Manager.
  2. Select LogicBlock 2.
  3. Open the Samples tab and click Import next to Examples.

The example scenes and Blocks are copied to Assets/Samples/LogicBlock 2/<version>/Examples. See Examples.

What LogicBlock 2 adds to your project

LogicBlock 2 writes one folder into your project: Assets/Plugins/LogicBlock2/Generated Parameters. It holds the parameter types, which are generated automatically (see Parameter types). Don't edit these files.

Quick start

This makes a reusable "Pop" effect and runs it from several objects.

  1. In the Project window, right-click and choose Create > Visual Script > LogicBlock > Instruction Block. Name it Pop.
  2. Select it. Under Instructions, click Add Instruction... and add Transform > Local Scale > Set Transform Local Scale. Set Transform to Source and Value to (1.3, 1.3, 1.3), with a short duration (for example 0.1 seconds).
  3. Add a second Set Transform Local Scale back to (1, 1, 1).
  4. Add an Event component to a cube with a collider. Add the trigger Input > Cursor > On Mouse Click.
  5. In the Event's instructions, click Add Instruction... and choose LogicBlock > Run Block. Pick Pop in the Block field.
  6. Do the same on as many cubes as you like and press Play. Clicking any cube runs the same Block on that cube.

Inside a Block, Source and Target are whatever the call passes in. Run Block passes its own Event's Source and Target by default, so Source in Pop is the clicked cube.