![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Lazulily |
I want to check if all variables (which are booleans) in an array are true or false.
EG. (VERY basic and stripped down pseudo code just meant to get the point across)
var array = [x, y, z]
func onClick():
array[0] = false #x to false
array[1] = false #y to false
array[2] = false #z to false
func _process(delta):
#THIS IS THE PART HERE I NEED HELP WITH
if all of array is false:
do_thing()
Thank you in advance.
If array[0] == false and array[1] == false and array[2] == false:
do whatever
umma | 2022-07-11 03:15
Is there not a more efficient way to do this? I am aware of this, but I want to check for ALL at the same time and if they ARE all false then it will do something.
Lazulily | 2022-07-11 03:45