Wessl / DH2650

0 stars 1 forks source link

Game crashes when player falls from platforms on scenes with pathfinding #12

Closed Wessl closed 3 years ago

Wessl commented 3 years ago

Presumably because the player is too far away to get a closest node defined, then when the enemy AI tries to get a targetNode there is nothing there. I'm guessing this is because of the maxDist in GetClosestNodeTo not reaching the player properly. Perhaps a default node can be assigned in this case, we don't want the game to crash if this occurs even if the player would have died in such a situation.

Error message is: NullReferenceException: Object reference not set to an instance of an object EnemyAI.UpdatePathNew () (at Assets/Scripts/Enemy/EnemyAI.cs:137)

I'll try to fix it, but I'm not super familiar with the code so we'll see if I can do it...