Can't get graphMask to work properly

Okay so I am trying to get the graphMask to operate properly, but I seem to be running into some issues
Essentially I have 3 graphs in this order:

  1. Recast Graph for ground units
  2. Grid Graph for floating units
  3. Grid Graph for air units

Each of these units only moves in the xz direction
I am using the AIPath.cs script and made the following adjustment to the Init function:

void Init () {
	if (startHasRun) {
        if(enemyType.Equals(EnemyType.Ground))
        {
            graphMask = 1;
        }
        else if (enemyType.Equals(EnemyType.Floating))
        {
            graphMask = 2;
        }
        else if (enemyType.Equals(EnemyType.Air))
        {
            graphMask = 3;
        }
        lastRepath = float.NegativeInfinity;
		StartCoroutine(RepeatTrySearchPath());
	}
}

public virtual void SearchPath () {
	if (target == null) throw new System.InvalidOperationException("Target is null");

	lastRepath = Time.time;
	// This is where we should search to
	Vector3 targetPosition = target.position;

	canSearchAgain = false;

	// Alternative way of requesting the path
	//ABPath p = ABPath.Construct(GetFeetPosition(), targetPosition, null);
	//seeker.StartPath(p);

	// We should search from the current position
	seeker.StartPath(GetFeetPosition(), targetPosition, null, graphMask);
}

It seems like it works just fine for the first two, but I am getting some wonky behavior from the third. The “wonky behavior” being that the air unit seems to be using the second graph instead of the third. Anybody see anything jumping out that’s incorrect regarding the setup?

Just started using this asset today so I’m still learning the ins and outs

Hi

The graph mask is a bitmask, not a simple integer.
Here is a tutorial on bitmasks: https://www.arongranberg.com/astar/documentation/dev_4_1_7_6425cc50/bitmasks.php

The TL;DR is that you should use:

graphMask = 1 << 0;
graphMask = 1 << 1;
graphMask = 1 << 2;

For the graphs with indices 0, 1 and 2 respectively.

Did not realize it was a bitmask haha thank you!