Is it crashing in the same way as before when the path is reached?
not exactly. It crashes after it reached the path when found_path and reached_dest are set to false to search the path again.
It's probably a bad idea to call DeleteAllLists in a coroutine. What is the purpose of you doing that?
ops sorry here, I tried to make it a coroutine that so I was sure it called FindPath() when it finished the execution of DeleteAllLists() but it didn't change nothing. So I made DeleteAllLists() a void but I forgot to change the calls in the update before updloading the code ^_^'
When reporting a crash it's essential to point out exactly what line it crashes on, what the error says, and ideally which function the current one (and down the stack), and so on. Unity provides a full call stack in the editor so you can probably copy and paste that.
Yes, I know but the problem, the thing that is making a lot much more harder to me and to all the good people that is helping is that it doesn't throw any error, nothing. Unity just totally crashes and I have to exit from the task manager. Anyway, it crashes in DeleteAllLists() when it clears the closed list. I tried to clear it alone and yes, when I clear the closed list it crashes and in the taskmanager there's a memory consumption of about 150/160mb.
you keep adding to the 'adjacent_nodes' list each time you expand a new node, and only clear it at the end. Normally adjacent nodes are just added to the open list for future consideration
Didn't notice that error, thank you for pointing me that out. I made this because in the foreach I thought "if I put the open list it will check also the already analyzed nodes" but apparently I didn't think good.