Make Array
![make array](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/make_array-e6eb0fff670004fdce9ba7b26c2e70d5.png)
Make Array allows for multiple items (for example, numbers, colors, vectors, and so on) to be stored in a single array. Add an item by clicking + and remove it by right-clicking the input name and selecting Remove pin. All data types are supported: Number, Boolean, String, Rect, Vec2, Vec3, Vec4, Color, Texture2D, Scene Object, and Material.
Input
Name | Data Type | Description |
---|---|---|
Enter | Exec | The input that triggers this node. |
Reset | Exec | Resets the current index logic. |
From | Number | Minimum value of the index. |
To | Number | Maximum value of the index. |
Mode | String | Loop, Random, or Shuffle. |
Loop Count | Number | Number of cycles. |
Ping-pong | Boolean | When selected, it outputs the set of numbers from the starting value to end value and then backwards. |
Output
Name | Data Type | Description |
---|---|---|
Next | Exec | Executes the next node. |
Index | Number | The output index in between From and To. |
Example
![make array example](https://sf16-va.tiktokcdn.com/obj/eden-va2/vhreh7flszld/large_assets/make_array_example.gif)
In this example, 5 Vec2 items have been stored in an array. Tapping the screen logs a random value from 0 to 4, in turn getting one of the items to be used for the image position.
![make array node](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/make_array_node-ade96d759138d73b3f47d169a3ac2015.png)