[HOWTO] How To: Get Lua Values With Visual Scripting

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Tony Li
Posts: 20712
Joined: Thu Jul 18, 2013 1:27 pm

[HOWTO] How To: Get Lua Values With Visual Scripting

Post by Tony Li »

This article explains how to get Lua variable values with Visual Scripting.

If you're using Dialogue System version 2.2.32 or older, download the updated Visual Scripting Support package from the Dialogue System Extras page.

To access DialogueLua methods such as GetVariable(), edit DialogueLua.cs. Add this line above the class name:

Code: Select all

[Unity.VisualScripting.IncludeInSettings(true)] // <- Add this line.
public static class DialogueLua
To get values such as variables, use a "Dialogue Lua > Get Variable" node. The output of this node will be a Lua Result.
Then use a "Dialogue System Visual Scripting Lua > Lua Result As Type" node to convert it to a basic type such as string,
bool, float, or int.
Post Reply