- Home /
Initialize multidimensional boolean array as all false Unity JS
When you initialize a multidimensional boolean array, is it possible to set them all to false, or would you have to loop through each value and assign to false?
Answer by Eric5h5 · Dec 24, 2010 at 03:13 PM
Booleans are structs, which are always initialized to false anyway.
Debug.Log(multiDimBoolean.ToString() ) evaluates to null (i.e. no change from default gui text)
Answer by Statement · Jan 11, 2011 at 06:42 PM
You need to create the array first. When the array is created, all booleans have false value, as that is the types default. You don't need to set each individual boolean value, but you need to create the array.
Your answer
Follow this Question
Related Questions
If...else statement with errors 1 Answer
Better way to delay a function for a few seconds? Javascript 1 Answer
JavaScript multidimensional array editing 1 Answer
Change Variable on Another Script 2 Answers
Drilling-game script's logical bug. 3 Answers