If
![if](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/if-b869ee9ff342ad16c43fe481f87ffa55.png)
Use If to pass in a value based on a condition. If is in the Control category.
Input
Name | Data Type | Description |
---|---|---|
Enter | Trigger | The input execution that triggers this node. |
Condition | Boolean | A boolean value that determines which output execution to be taken. Select it to pass the true value only. |
Output
Name | Data Type | Description |
---|---|---|
True | Trigger | Execute the next node if the condition is true. |
False | Trigger | Execute the next node if the condition is false. |
Example
![if example](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/if_example-1915a0b5b3d01ed7537b4e29d6d3f73d.gif)
This example gets the sphere’s position in realtime. If the x-axis is greater than 0, then the sphere will turn red. If the x-axis is less than 0, it will turn green.
![if node](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/if_node-44f003947edc2e10b3fe7f89e3afd64e.png)