Hey guys, this is just a quick question to fix a silly mistake I made.
public static void FindAdjacents()
{
print (Manager_Levels.tilesAll[1].transform.position);
foreach (Tile_Levels FindAdjacentTile in Manager_Levels.tilesAll) {
//toplayer
if (FindAdjacentTile.transform.position == new Vector3 (transform.position.x - 1, transform.position.y + 1, transform.position.z + 1))
`` { tileUpFwdLft = FindAdjacentTile;}
so this is just a small excerpt of my script so you can see what’s happening, findAdjacents() is called by my otherscript Manager_Levels, findAdjacents() then grabs an array in Manager_Levels to use the arrays components to findout if one of the components in the array is at a certain position. But what my problems is, is that my print() is showing the transform position of component [1] in the array, but in the foreach loop it says that i need a reference to access component.transform.
That’s my question, I hope it wasn’t too messy or unclear
thanks for your help