Types

In modern scripting, everything is an Object: numbers, pieces of text, vectors and Unity components are all objects. To differentiate what they represent and what they can do, each object has a Type. In Bolt, most types are represented with an icon.

There are hundreds of types available in Unity and Bolt, but you don't need to know each of them by heart. However, you should be familiar with the most common types. Here's a little summary table:

IconTypeDescription
FloatA number with or without decimal values, like 0.5 or 13.25.
IntegerA number without any decimal value, like 3 or 200.
BooleanA value that can only be either true or false. Commonly used in logic or in toggles.
StringA piece of text, like a name or a message.
CharOne single character in a string, often alphabetic or numeric. Rarely used.
EnumsThere are many enums. Each one is a finite enumeration of options that are often seen in dropdowns.

For example, in Unity, the "Force Mode" enum can be either "Force", "Impulse", "Acceleration" or "Velocity Change".




VectorsVectors represent a set of float coordinates, for example for positions or directions.

There are 3 vectors in Unity:
Vector 2, with X and Y coordinates for 2D;
Vector 3, with X, Y and Z coordinates for 3D;
Vector 4, with X, Y, Z and W coordinates, rarely used.
Game ObjectGame objects are the base entity in Unity scenes. Each game object has a name, a transform for its position and rotation, and a list of components.
ListsA list is an ordered collection of elements. The elements can be of any type, but most often, all elements of a list must be of the same type. You can retrieve and assign each element in a list by its zero-based index (position).
DictionariesA dictionary is a collection in which element has a unique key that maps to its value. For example, you could have a dictionary of age (integer values) by name (string key). You can retrieve and assign each element by its key.
Object"Object" is a special type. Like we said, every other type is also an object. But when you see, for example, that a node asks for an object, it usually means that it doesn't care about the type of that object.

When you need to select a type, Bolt will display a menu like this one:


As you can see, the most common types are available at the top. Enums are grouped at the bottom. All other types are grouped in their Namespace, which is nothing more than a "folder" for types. All Unity components and types are found under the Unity Engine namespace.

This article was helpful for 63 people. Is this article helpful for you?

+1

John, please create a community thread to ask questions! This will keep the manual cleaner for future users.

As you've been answered I'll delete the comments.

How to manage a list in a variable with only get and set? Should I "Get Variable" and use "List Interface Add", will this add the new value to the variable holding the list? If so, "set variable" will rarely be used, correct?

+1

Set Variable will only be used once after Create List.

Then, you'll use Get Variable to pass to Add List Item, located under Collections > List.

+2

Lazlo, answers at the bottom of help topics are far more useful than ‘go to the forums and hope you find an old thread or twelve.’

Clean /and informative/ needs to be the goal here.

Rule 1 of Rule design: all the stuff about X goes in the X section of the rules. /all of it/.

For example, this comment can be deleted when acted upon. Andre should get an answer here, so the rest of us do not have to go on a treasure hunt.

+1

I agree, although John's (deleted) question was entirely unrelated to the content of this page

if I recall correctly my question was 'why can't I create lists in a graph?' And the answer was because I was in Android and AOT platform support isn't quite there yet. 

There is a doc page for that somewhere but mentioning it here would be helpful, no? At least the word AOT/mobile/Android? I don't think it's entirely unrelated... And it's no the first time AOT has been an issue. I recall making a forum post because the 'Type' type was unsafe. There is a doc page for that... but why not mention it in the Types section of the manual? Or at least mention the AOT safe mode option? It doesn't seem like the worst place to put it... and the time it would take to add would probably be less time than you've taken to post here about how irrelevant it was.

+1

Do you have a PDF file or any downloadable version of the manual? If not, can I request for one? Thank you.