Skip to main content
Integrating the answer into OP's perspective.
Source Link
Vaillancourt
  • 16.4k
  • 17
  • 56
  • 61

Random.Range will return an integer if both min and max are integers. Random.Range(0,2) will return either one or zero. You could use it like this:

Boolean boolValue = (Random.Range(0, 2) == 0);
if(boolValue == true){
    Debug.Log("It's true!");
} else{
    Debug.Log("It's false!");
}

Random.Range will return an integer if both min and max are integers. Random.Range(0,2) will return either one or zero.

Random.Range will return an integer if both min and max are integers. Random.Range(0,2) will return either one or zero. You could use it like this:

Boolean boolValue = (Random.Range(0, 2) == 0);
if(boolValue == true){
    Debug.Log("It's true!");
} else{
    Debug.Log("It's false!");
}
Source Link
SanSolo
  • 1.2k
  • 1
  • 10
  • 29

Random.Range will return an integer if both min and max are integers. Random.Range(0,2) will return either one or zero.