The first pinned post in the forum asks you to use code tags . So please edit your post to include them.
And parts of your code is missing (especially some variable declarations).
When you write “dynamically creates quads” do you refer to (A) while the player is playing the game or (B) before the player plays?
Usually to refer to neighbouring cells of your grid you would need a data structure to refer to them which could be setup during initialization for scenario (A). For scenario (B) you would need some kind of “coordinate” which can be found. So when you are at 5,2 and want the cell to the right you query a manager class which knows each cell for 6,2.