Hi, I am making my own pathfinding solution to fit my game and so far it works but I just added a new function in my code and my List is not being properly adjusted.
Here is the code:
void findPathOfSplitNodes()
{
splitNodesPath = new List<List<GameObject>>();
//We find the path starting at each split node and then save that path in a list
for(int i = 0; i < allSplitNodes.Count; i++)
{
splitNodesPath *= new List<GameObject>();*
splitNodesPath.Add(goThroughPath(allSplitNodes[0]));
}
}
The problem is with splitNodesPath _= goThroughPath(allSplitNodes*);*
Thanks for the help!_
I updated my code to fit yours.... still does not work.
– calmcarrotsWhat exactly di you change to?
– KiwasiI updated my code. It still does not work.
– calmcarrotsRemove line 8 that was a test to see where the error was. If using new causes an error then replace with the add line. Here is the code I intended you write in my answer void findPathOfSplitNodes() { splitNodesPath = new List<List<GameObject>>(); //We find the path starting at each split node and then save that path in a list for(int i = 0; i < allSplitNodes.Count; i++) { splitNodesPath.Add(goThroughPath(allSplitNodes*));* } }
– Kiwasi