SingleNodeBlocker Not Blocking (setting BlockManager via Awake)


I’m trying to use the SingleNodeBlocker (using the TurnbasedExample given as a reference) and I got it working in a little test scene, but as soon as I tried to move it out of the test scene and implement it into another system it stopped using the blockers.

Since you cannot save references to other gameobjects in prefabs, I added a protected override void Awake() in the SingleNodeBlocker script with a line that sets the BlockManager reference (the block manager is attached to the same object that the TurnBasedManager() is attached to).

protected override void Awake()
manager = GameObject.FindGameObjectWithTag(“MovementManager”).GetComponent();

I’ve done similar things for everything that needs to reference the block manager and movement manager including TurnBasedAI().

protected override void Awake () {
blockManager = GameObject.FindGameObjectWithTag(“MovementManager”).GetComponent();
traversalProvider = new BlockManager.TraversalProvider(blockManager, BlockManager.BlockMode.AllExceptSelector, new List() { blocker });
rangeProvider = new BlockManager.TraversalProvider(blockManager, BlockManager.BlockMode.OnlySelector, new List() { blocker });

I have a SingleNodeBlocker() on players, enemies, and objects. I have a TurnBasedAI() on players and enemies. I have a BlockManager() on the TBMovementManager prefab, so I can add it to other scenes easily.

Is it an issue trying to get a reference to the BlockManager via awake, rather than setting it in the inspector before playing? I need to be able to set those on game objects through scripts since I am spawning things in. Any help would be greatly appreciated!

Thank you!