Nodes

Anatomy Of A Node

 

With the exception of Variable nodes (see "Variables"), all nodes in uScript have the following components:

 

 

 

 

Node Types

uScript has three major types of nodes that you use in combination to make a functional uScript graph. For more detailed information on how these node types all work together to great a visual script, please also see "Creating Graphs".

 

Event Nodes

Event nodes are the driving force behind all uScript logic. uScript is an event driven system that allows you to execute logic when events happen in the game. Event nodes can be found in the "Events" section of the uScript Toolbox.

 

Rules of Event Nodes:

 

 

Example Event Nodes:

 

 

 

How to use them:

The event node(s) you choose determine when and how any logic hooked up to them will execute. As an example, let's take a look at some very simple logic that turns off the Light component on a GameObject called "MyLight":

 

 

 

The above logic will never run because there is no event telling it when to turn the light off. In order to do that we would need to hook up an Event Node to its "Turn Off" socket (because we want to turn the light off in this example).

 

We have many choices of events that can help us determine exactly when we want the above logic to execute. Here are three examples using different Event Nodes.

 

When entering a trigger:

 

When the graph first runs:

 

When the player hits the SPACEBAR key:

 

IMPORTANT!- You do not need to hook up an Event Node to every action node directly. You are free to chain action nodes together, but in order for any of the action nodes to receive a signal, there must be an Event Node somewhere at the beginning of the chain.

 

The following is perfectly fine to do. All these actions nodes will fire in order once the Event has happened (when the graph first loads in this case) and sends out a signal to the first node in the chain:

 

 

 

Action Nodes

Action Nodes are the "meat" of a visual scripting graph. Each Action node performs a small bit of specific logic. You combine these nodes and their simple actions in different combinations to create complex logic for use in your game. Think of Action Nodes as toy building blocks of simple shapes that you can use in any combination you can imaging to build a complex structure.

 

Action nodes can be found in the following sections of the uScript Toolbox-- Actions, Conditions, Graphs, and Reflected (reflection is not supported in uScript Basic).

 

Rules of Action Nodes:

 

 

Example Action Nodes:

 

 

 

How to use them:

Action Nodes are used together to form complex actions from their simple behaviors. Here are a couple examples of how to use some Action nodes to create specific game logic you might find in a game. Notice that there is an orange Event Node at the start of each of the examples.

Printing the current day to the Unity console when the game starts:

 

(the resulting text on a Monday would be "Today is: Monday")

 

 

Moving a platform when the player hits a trigger and play a sound when it is done moving:

 

 

Variable Nodes

Variable nodes are considers support nodes (usually color coded) that are used by both Event and Action nodes to store and retrieve data. Variable Nodes come in a few different types and shapes, but for the most part perform are used in a similar fashion in a uScript graph-- to get or set information used by Action and Event nodes. Please see the "Variables" section for more information on these types of nodes.

 

 

Node Documentation

uScript supports in-editor documentation for all nodes. To see the documentation for a specific node, you can either hover the mouse over the node in the Toolbox or select a node on the Canvas. The documentation for the node will show up in the References panel found below the Canvas area.

 

Please see the Reference Panel section of "Editor Interface" for more information.