//Call the wall texture sprite and give the grid private void CreateWall() { Transform o = Instantiate(wallTexture, transform.position, Quaternion.identity, transform); GenerateWall script = o.GetComponent <GenerateWall>(); WallMap.GetComponent <Renderer>().sortingOrder = -10500; script.Create(_grid, PerspMap, WallMap, ShadWMap, ShadSMap, ShadCornMap); }