Hey all,
So I have this code in a for loop.
string objCreated = "C" + t.ToString() + r.ToString() + d.ToString() + l.ToString();
print("object created " + objCreated);
GameObject currentObj = GameObject.FindGameObjectWithTag(objCreated);
borderArray[x,z]= currentObj;
What is happening with the code that happens before this section, is it is checking tiles around the current x,z location in the array, if the tile above, below, left, right is a 0 or 1 for each tile and if there is no tile up down left or right it creates a 1 or 0.
My tile names are all 1100 or 0110 etc 0 means off 1 means on or open. So with the random 1 or 0 generates my tile name C1111. I have 16 combinations of tiles which are my prefabs and also called C1010 etc etc…
Thus I am entering the generated name into a string variable. I then want to call the actual prefab and enter it in the current x,z coords in my array[,].
The problem I have is I always get a Null value and thus no tile is chosen and no tile is entered in my array. If I manually type in the tile name, this will be entered.
What am I missing or misunderstanding with calling tags, or using .name ?