I am trying to creating a pathfinding script and I have a list of nodes that I want to move to another script. Does anyone know how to do this? Thanks in advance.
Example (I need to move the values from this list to a list on another script):
public List<Node> grid;
[System.Serializable]
public class Node {
public Vector3 position;
public bool walkable = true;
}
//Adds nodes...
There are several ways, for example considering your script is on an object. So get the object to whom you want to assign the list i.e. using tag.
ClassName a = object.GetComponent();
Now you can assign object a list to public data