- Home /
Pathfinding And Adding Obstacles during runtime
I am using A* Pathfinding Project by aron granberg and I'm making a TD based game. I am able to get my units to move from waypoints to the destination. They do this by following a gridgraph. But when I place a tower on or in the way of the units path I get errors. The error reads, "Very high penalty applied. Are you sure negative values haven't underflowed? Penalty values this high could with long paths cause overflows and in some cases infinity loops because of that." The units end up doing circles when this error shows up. I have searched for ways to fix this and I cannot find a way to do this. The code that updates the gridgraph nodes when I place a tower is as follows:
GraphUpdateObject guo = new GraphUpdateObject(bl.buildingGameObject.collider.bounds); AstarPath.active.UpdateGraphs (guo);
This code makes the nodes within the bounds of the tower become disabled.
Any suggestions?
Your answer
Follow this Question
Related Questions
Why did my Transform Component stop using degrees for rotation 2 Answers
Pathfinding Point and Click 0 Answers
A* Pathfinding Project, Funnel Path Goes Through Non-Walkable (2D) 0 Answers
I'm facing this error when i hit scan in A* path finder. How to solve this? 1 Answer
'EventType' does not contain definition for "MouseUp" 1 Answer