Select
![select](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/select-c303657b0c58f3f4f9ad22ae811eda60.png)
Use Select to select an item according to the input index (Supporting Number, Vec2, Vec3, Vec4, String, Color, Texture 2D, Rect, Material). Select is in the Utility category.
Input
Name | Data Type | Description |
---|---|---|
Index | Number | Controlling which item to be selected, it will be rounded to 0, 1, 2 etc. For example, if the input is 1.4, it will be recognized 1, if it is 1.5, it will be 2, so on and so forth. |
Item 0 | Number | Any input item according to set type, will be selected if index is 0. |
Item 1 | Number | Any input item according to set type, will be selected if index is 1. |
Item 2 | Number | Any input item according to set type, will be selected if index is 2. |
Output
Name | Data Type | Description |
---|---|---|
Item | Number | Selected item according to the current index input. |
Example
![select example](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/select_example-45e829bd05a66d15db2fed1f39d2fc88.gif)
This example shows how to select a random texture for the 2D image.
![select node](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/select_node-c0d5a3a806aaa923738371eabf472372.png)