Hi again,
The AI I have currently does a check for the players position, they always know the position, so in my code below I have the code that gets the current position of the persons turn, then the target they are checking the distance between. But for some reason when I have the traversal modifier on the player, which is written the same as you have on your Demo AI.
public void TraversalProviderSetup()
{
// Set the traversal provider to block all nodes that are blocked by a SingleNodeBlocker
// except the SingleNodeBlocker owned by this AI (we don't want to be blocked by ourself)
traversalProvider = new BlockManager.TraversalProvider(blockManager, BlockManager.BlockMode.AllExceptSelector, new List<SingleNodeBlocker>() { blocker });
}
it doesn’t move at all, says that the costOfPath is equal to 0. I’m not sure why the code is doing this. Each unit has a single node blocker and all have the TraversalProviderSetup. But for some reason the Constructed path between the 2 is saying it’s equal to 0. This is what the grid looks like, as you can see, there isn’t anything blocking the players
Was wondering if you’d know why this is happening. It only happens when the line of code
path.traversalProvider = CurrentUnitTurn.traversalProvider;
is enabled. Also when I use the blocker.BlockAtCurrentPosition function, it’s not actually blocking the player. Or if it is it blocks itself for some reason.