Problems with the team manager, Reset task gets stuck

Hello,

I am using the Deathmatch AI Kit with the team behaviour tree. I have setup the enemy layers and added the team grouping, but when I start the match, the bots get stuck and their behaviour trees never get past the Reset task. There are also errors being logged in the console, namely this one:

Code:
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <695d1cc93cca45069c528c15c9fdd749>:0)
Opsive.DeathmatchAIKit.TeamManager.CancelBackupRequestInternal (UnityEngine.GameObject player) (at Assets/Plugins/Opsive/DeathmatchAIKit/Scripts/Game/TeamManager.cs:341)
Opsive.DeathmatchAIKit.TeamManager.CancelBackupRequest (UnityEngine.GameObject player) (at Assets/Plugins/Opsive/DeathmatchAIKit/Scripts/Game/TeamManager.cs:326)
Opsive.DeathmatchAIKit.AI.Actions.Reset.OnUpdate () (at Assets/Plugins/Opsive/DeathmatchAIKit/Scripts/AI/Actions/Utility/Reset.cs:94)
BehaviorDesigner.Runtime.BehaviorManager.RunTask (BehaviorDesigner.Runtime.BehaviorManager+BehaviorTree behaviorTree, System.Int32 taskIndex, System.Int32 stackIndex, BehaviorDesigner.Runtime.Tasks.TaskStatus previousStatus) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.BehaviorManager.Tick (BehaviorDesigner.Runtime.BehaviorManager+BehaviorTree behaviorTree) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.BehaviorManager.Tick () (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.BehaviorManager.Update () (at <58623c9461324266a5b7839460bb9d26>:0)

I have manually added the Team Manager script to another GameObject. Also, I am using the PUN add-on, so these bots are being spawned over the network using the NetworkObjectPool class. I am testing using offline mode. There seems to be little documentation or tutorials on the team mode, so any assistance would be appreciated. Thank you.
 
It doesn't sound like that player has been registered with the TeamManager. Make sure TeamManager.AddTeamMember is called for that player.
 
It doesn't sound like that player has been registered with the TeamManager. Make sure TeamManager.AddTeamMember is called for that player.
Hey Justin, thanks for the quick response. I determined why those errors were occurring. I was respawning the bots when they were being instantiated to make sure they were at the correct spawn locations. What I have done is called AddTeamMember after the bot respawns, and now those errors have disappeared and the bots are moving around as they should.

Just a final question, does manually calling the Respawner.Respawn function prevent the AddTeamMember function from getting called in the first place? I know it gets called in the DeathmatchAgent Start function, but when I debugged it, the function wasn't even being called.
 
Top