Hi guys, I hope you are fine. I have an interesting question :D. I am watching course video right now and I want to ask my question ASAP. In this course we are trying to add path to our list which is “List path = new List();” (WayPoint is a class). We get all game objects by using this code "GameObject wayPoints = GameObject.FindGameObjectsWithTag(“Path”); " and we add these game objects to our list with this code “foreach (GameObject waypoint in wayPoints)
{
path.Add(waypoint.GetComponent());
}”
My first question is why we cannot use path.add(wayPoints) instead of using “path.Add(waypoint.GetComponent());” and how does this code actually work ?
thank you in advance