Well, im making a tower defense game and when a user create a new tower i need to update the graph(im using a grid graph), so i use AstarPath.active.UpdateGraphs (gameObject.collider.bounds) and it works perfect but the user can also destroy the tower but i dont know how to put the space where the tower was, avaible again.
And another thing, there is a way i can check in the graph if the space is avaible to create a new tower?
UpdateGraphs() should work just fine for rescanning the area once the tower is gone.
`pubic void RemoveTower(subject){
Bounds Subject_area = subject.collider.bounds;
//Destroy tower, display animation, and any other actions here
AstarPath.active.UpdateGraphs(Subject_area;
“Check in the graph if the space is avaible to create a new tower?”
I would just use the collider to check if you can place the tower. While you can do it with A*, it would be more resource intensive then just using collision detection.
thanks man, the 1st question helped but i think i wasnt clear enought in the 2nd question, what i mean was if there is a way i can check if the tower is going to block the path, something like that: if i put one tower in the arrow below the path is going to be blocked.