void OnCollisionEnter(Collision coll) { if (coll.gameObject.tag == "Tile" && myTile == null && coll.gameObject.transform.position.x == this.transform.position.x && coll.gameObject.transform.position.z == this.transform.position.z) { haveILanded = true; myTile = coll.gameObject; scriptToEdit = myTile.GetComponent <TileClicker> (); //If i land on a tile, mark this tile as my tile so i can make it clickable again later. } }
void OnCollisionEnter(Collision coll) { if (coll.gameObject.tag == "Tile"&&myTile==null&&coll.gameObject.transform.position.x==this.transform.position.x&&coll.gameObject.transform.position.z==this.transform.position.z) { haveILanded = true; myTile = coll.gameObject; scriptToEdit = myTile.GetComponent<TileClicker> (); //If i land on a tile, mark this tile as my tile so i can make it clickable again later. } }