Unity Visual Scripting (ex-Bolt)

← Back Quick start guide

Description

This is a step-by-step guide and example project to help you to start using database data with Visual Scripting quickly. We use database data and Visual Scripting (VS) script machine to spawn prefabs at provided positions

Example project setup guide

  1. Download and unzip example project
  2. Open unzipped project in Unity. Ignore the errors
  3. Import BGDatabase package. The errors should be gone
  4. Run Scenes/SampleScene scene

Step-by-step guide

  1. First of all we need to create database data. One table "Prefabs" is enough for our task We need to add 2 fields to it- "prefab" with prefab type (this is a prefab we want to spawn) and position with Vector3 type (this is a position for spawned prefab)
  2. Generate VS nodes for created table. The full list of generated nodes can be found here. There are few nodes per each table generated, but these nodes give you full access to database data - you can read and write (if the cell is not readonly) any cell, and you can access any row, and you can add new or delete existing rows. Use the same settings as on the screenshot below. Press on "Generate" button to generate nodes.
  3. At this point you probably need to update VS nodes repository, select Edit->Project Settings->Visual Scripting and click on "Regenerate Nodes" button
  4. Now we can use database nodes inside VS scripting machine, the generated nodes can be found under BansheeGz category
  5. What we want to achieve is to iterate Prefabs table rows and spawn a prefab for each row at provided position. Here is a node graph that perform this task
  6. Our guide is finished. Make sure to read our main article about using database data with VS here
← Back to Unity Visual Scripting (ex-Bolt)