- Home /
Looping through array to find a specific class?
I have an array of a class witch is called Block. The block class two variables: position(witch is a Vector3) and type(String). In my script I assign the position and type through a for loop. When I run the script it creates an array of 9 "Blocks". My next step is to make each Block of the array check if there are any blocks around it with the type of "dirt", but after an hour of trying I ended up with nothing. Could anyone help be do this? I think I need a for loop that checks if a block is at a specific position and has a specific type.
Your answer
Follow this Question
Related Questions
Compare Position of two gameobjects and if true, do nothing, help me please! 1 Answer
how would I make an array of different scripts 1 Answer
Calculating Rows in an inventory. Help simplifying code. 3 Answers
store instantiated in Array. c# 1 Answer
How to store TYPE variables names into an Array, and assign values to them. 0 Answers