The If node Identifies which statement to run based on the value of a Boolean expression.
The True connector will be executed if the input Condition is true, otherwise the False connector will be executed.
The Finished connector will be executed always after the True or False code.
Examples
Flow Graph:
Generated Script:
using UnityEngine; using System.Collections; using System.Collections.Generic; public class test : MonoBehaviour { public bool condition = true; public void Update() { if(condition) { Debug.Log("The variable is set to true."); } else { Debug.Log("The variable is set to false."); } } }
Output:
The variable is set to true.