Wiki

Case Status
Log In

Wiki

 
Home ยป Core Concepts»Variables»Array Variables
Index
Navigation
Community Wiki

Array Variables

An Array Variable can store a collection of values of a given type. E.g. A Float Array can store float values, an Object Array can store Object values etc.

Note: An Array in PlayMaker is a hybrid of an Array and List in C#. It could just as easily have been called List.

When you create an array variable you also need to define the type it can contain.

For example, here is an array containing colors:

 

You can think of an Array as a variable with numbered slots:

For example, a string array called Names containing 4 names:

The number of the slot is called the Index of an item. For example, the name at index 2 is Han.

Note, the index of the first item is 0, the second item is index 1, and so on.

This index system lets you access items in an array.

Use Array Actions to work with arrays.

Examples

Use Array Get to get the 3rd name in Names and store it in a String Variable:

Use Array Add to add a name to Names:

Result:

Diagram:

 

 

See Also:

 

Tags:

Last modified on 2/8/2021 2:32 AM by User.

  • RSS Feed