SingleNodeBlocker blocking itself

  • A* version: 5.3.8
  • Unity version: 6000.0.33f1

Hey,
I’m trying to set up entity blocking so my characters can’t move through each other. I got it working but they seem to be blocking themselves…
image

the cyan line is starting at the point next to the character and pathing to the mouse, so it looks like because the character is blocking itself it’s pathing from the next nearest node.
I have a manager for the obstacles, is it because the characters need their own list of obstacles and won’t automatically ignore their own blocker?

I’m setting it like this because I instantiate the characters in runtime

private SingleNodeBlocker blocker;
public void Start()
{
blocker = GetComponent();
GameObject blockerManager = GameObject.FindGameObjectWithTag(“BlockerManager”);
blocker.manager = blockerManager.GetComponent();
blocker.BlockAtCurrentPosition();
}

Figured it out, i was keeping a list of the blockers in a manager but i had to make each character fetch it then filter out their own blocker to stop them blocking themselves.

1 Like