RecastGraph Runtime Update

Hi, really like the library so far, but getting stuck right now trying some basic things.

Setup:
I have one plane, and one building which is a bit elevated and a ramp going up to it.

Test 1 (working)
I have a Recast Graph setuped, and if I manually hit “Scan”, a graph is correctly generated and I can move some actors along the plane, over the ramp, and inside the building.

Test 2 (not working)
Same plane, but hit scan while the building is deactivated. Now I add a script to the Building which gets the collider bounds (mesh collider) and runs AstarPath.active.UpdateGraphs.

Result: Big square around the building is cut out of the graph and not walkable anymore (not part of the bounds of the building), and the buildings inside are not added, also just some parts of the ramp are walkable.

Expectation:
Adding the Building to the graph at runtime should create the same Graph as adding it in editor via scan utility

Latest beta version installed

Hi

Would you mind sharing a screenshot of this?

Graph scanned in Editor:

Updated at Runtime:

Code on Building:


    void Start()
    {
       var bounds = GetComponent<Collider>().bounds;
       var gu = new GraphUpdateObject(bounds);
       AstarPath.active.UpdateGraphs(bounds);
    }

Hmmm… That looks very much like the tiles failed to generate. There are no error messages in the console?

Damn, i’m so dumb… not an error but a warning. the building is marked as static which the warning says is not allowed.

Sorry for the obvious error on my side :slight_smile:

1 Like