GridGraph does not want to change node count from script

I have problem with GridGraph, it only works half way. So at this page -
“Configure using script”
GridGraph is working with -
gg.nodeSize = 1; or;
all fine, but when I try to change node width or depth, it does not change.
aka - this part of the code.
gg.width = 50;
gg.depth = 50;

My code!

void SetupAStar()
Bounds bounds = new Bounds(transform.position,;
foreach(Renderer r in GetComponentsInChildren())
AstarData data = GameObject.Find(“A*”).GetComponent().astarData;
GridGraph gg = data.gridGraph; =;
gg.width = (int)bounds.extents.x;
gg.depth = (int)bounds.extents.y; //It doesnt matter If I use this code or raw numbers. gridgraph does not change depth or width.;

Does any one can spot whats the problem? Why GridGraph does not change width or depth? The width and depth node count does not change.

EDIT : Found my solution - > Unable to set gridgraph height and width from code

1 Like