Support Forum

It is possible to use LayeredGridGraph without physics?

Hi!
I have been using GridGraph but I need to make movement on fortifications. NPC needs to use the stairs to go on them.
I’m updating graph through script. Also I’m using custom Frustum Culling with Object Pooling so only objects on the screen are “really there”.Outside of camera view I have empty terrain and nothing more.

When I update the ground level data, everything is fine. The problem appears when I want to set something above ground level (like floor of the wall)

When I’m using colliders and GraphUpdateObject.updatePhysics = true; everything is working like expected:


I just want the same effect, but without colliders. It’s possible?

This is how I was updating graph through script:

        public void Add(Bounds bounds, bool walkable = false, bool modifyTag = false, PathfindingTags tag = PathfindingTags.BasicGround)
        {
            GraphUpdateObject graphUpdateObject = new GraphUpdateObject(bounds);
            
            graphUpdateObject.modifyWalkability = true;
            graphUpdateObject.setWalkability = walkable;

            if (modifyTag)
            {
                graphUpdateObject.modifyTag = true;
                graphUpdateObject.setTag = (int) tag;
            }
            
            AstarPath.active.UpdateGraphs(graphUpdateObject);
        }
            //ground
            bounds = new Bounds(wall.Position, _boundSize);
            _pathfindingGraphUpdater.Add(
                bounds,
                false,
                true
            );

            //wall floor (this isn't working)
            bounds = new Bounds(wall.Position + new Vector3(0f, 2.6f, 0f), _boundSize);
            _pathfindingGraphUpdater.Add(
                bounds,
                true,
                true
            );

Hi

The graph needs to be able to get information about the world in some way. There are not a lot of other options than using physics I’m afraid.