Hi,
I am getting error
“CS1579 foreach statement cannot operate on variables of type ‘WayPoint’ because ‘WayPoint’ does not contain a public instance definition for ‘GetEnumerator’”
for the following code
Dictionary<Vector2Int, WayPoint> grid = new Dictionary<Vector2Int, WayPoint>();
-
// Start is called before the first frame update*
-
void Start()*
-
{*
-
LoadBlocks();*
-
}*
-
private void LoadBlocks()*
-
{*
-
var wayPoints = FindObjectOfType<WayPoint>();*
-
foreach (WayPoint wayPoint in wayPoints)*
-
{*
-
grid.Add(wayPoint.GetGridPos(), wayPoint);*
-
}*
-
}*
I am unable to get around this. Please help.
Thanks,
Shaktimaan