Agents have not affected by the bullets.

Hi, why would the agents not have affected by the bullets? And don't die too.
The bullets stick on the agent's body, you feel like a transparent object around the agent.
Please take a look on the attached photo.
 

Attachments

  • players.jpg
    players.jpg
    50.1 KB · Views: 3
This is likely a layer issue. Within your shootable action make sure you are hitting the layer that your enemies are on (likely the Enemy layer). You can prevent the decals by using the SurfaceIndicator component on the enemy collider - take a look at the demo scene for an example.
 
But the agents attack my player and kill him.
The problem, that sometimes the agents are acting like they are out of play, the bullets show as you see in the image, but they can turn back and kill the player.
But sometimes, I guess they are out of bullets for example, so they don't attack, is that possible?
 
Do you mean Surface Identifier not SurfaceIndicator?

Also, I made a copy of the demo, updating it as required.
Now, the agents kill the player, and the player is killing the agents, but the enemies are killing each other?
- The behavior tree doesn't change from Solo to Team for the agents.
- Deathmatch Manager Script on DeathmatchGame, Players count = 8, Players per team = 4, Team count = 2.
And all checkboxes are unchecked.
- All agents are assigned to the layer "Enemy", and they supposed to attack the layer "Character" which the player is assigned to it.
 
Ok, I changed the code of the DeathMatch to work with my needs. And added the player on a standalone team vs a team of the agents. And it works fine.

But there are two errors show up, some agents work normaly and attack the players, while others are frozen, I think they need a leader as in the first error, and an error occur during calling backup of other team's agents?
Would you please, give me a hint to fix those errors?

1)
NullReferenceException: Object reference not set to an instance of an object
Opsive.DeathmatchAIKit.AI.Actions.VFormation.MoveIntoPosition () (at Assets/Opsive/DeathmatchAIKit/Scripts/AI/Actions/Team/VFormation.cs:115)
Opsive.DeathmatchAIKit.AI.Actions.VFormation.OnUpdate () (at Assets/Opsive/DeathmatchAIKit/Scripts/AI/Actions/Team/VFormation.cs:98)
BehaviorDesigner.Runtime.BehaviorManager.RunTask (BehaviorDesigner.Runtime.BehaviorManager+BehaviorTree behaviorTree, System.Int32 taskIndex, System.Int32 stackIndex, BehaviorDesigner.Runtime.Tasks.TaskStatus previousStatus) (at Assets/Behavior Designer/Runtime/BehaviorManager.cs:1300)
BehaviorDesigner.Runtime.BehaviorManager.Tick (BehaviorDesigner.Runtime.BehaviorManager+BehaviorTree behaviorTree) (at Assets/Behavior Designer/Runtime/BehaviorManager.cs:1111)
BehaviorDesigner.Runtime.BehaviorManager.Tick () (at Assets/Behavior Designer/Runtime/BehaviorManager.cs:1049)
BehaviorDesigner.Runtime.BehaviorManager.Update () (at Assets/Behavior Designer/Runtime/BehaviorManager.cs:1005)

2)
NullReferenceException: Object reference not set to an instance of an object
Opsive.DeathmatchAIKit.AI.Conditions.ShouldProvideBackup.OnUpdate () (at Assets/Opsive/DeathmatchAIKit/Scripts/AI/Conditions/Team/ShouldProvideBackup.cs:34)
BehaviorDesigner.Runtime.BehaviorManager.RunTask (BehaviorDesigner.Runtime.BehaviorManager+BehaviorTree behaviorTree, System.Int32 taskIndex, System.Int32 stackIndex, BehaviorDesigner.Runtime.Tasks.TaskStatus previousStatus) (at Assets/Behavior Designer/Runtime/BehaviorManager.cs:1300)
BehaviorDesigner.Runtime.BehaviorManager.Tick (BehaviorDesigner.Runtime.BehaviorManager+BehaviorTree behaviorTree) (at Assets/Behavior Designer/Runtime/BehaviorManager.cs:1111)
BehaviorDesigner.Runtime.BehaviorManager.Tick () (at Assets/Behavior Designer/Runtime/BehaviorManager.cs:1049)
BehaviorDesigner.Runtime.BehaviorManager.Update () (at Assets/Behavior Designer/Runtime/BehaviorManager.cs:1005)
 
It looks like your using the Team tree? Is a leader set for the VFormation task? That looks like the problem for both errors.
 
a) When I added the line of code to set one of the agents as the leader of the team:
TeamManager.SetLeader(aiAgent, false);

It generates the error:
3)
Error: Unable to find formation group with leader DeathmatchGame (UnityEngine.GameObject)
UnityEngine.Debug:LogError (object)
Opsive.DeathmatchAIKit.TeamManager:SetLeaderInternal (UnityEngine.GameObject,bool) (at Assets/Opsive/DeathmatchAIKit/Scripts/Game/TeamManager.cs:206)
Opsive.DeathmatchAIKit.TeamManager:SetLeader (UnityEngine.GameObject,bool) (at Assets/Opsive/DeathmatchAIKit/Scripts/Game/TeamManager.cs:175)
Opsive.DeathmatchAIKit.Demo.Game.DeathmatchManager:SceneLoaded () (at Assets/Opsive/DeathmatchAIKit/Demo/Scripts/Game/DeathmatchManager.cs:334)
Opsive.DeathmatchAIKit.Demo.Game.DeathmatchManager:SceneLoaded (UnityEngine.SceneManagement.Scene,UnityEngine.SceneManagement.LoadSceneMode) (at Assets/Opsive/DeathmatchAIKit/Demo/Scripts/Game/DeathmatchManager.cs:217)
UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded (UnityEngine.SceneManagement.Scene,UnityEngine.SceneManagement.LoadSceneMode)


b) Also, I still the first error exists, I tried try to add a line of code:
TeamManager.AddToFormation(aiAgent, behavior);
I tried to make behavior refers to the behavior tree on the agent, such as: aiAgent.GetCachedComponent<BehaviorTree>();

c) Also, how to search the Decision Tree to find a specific task in the "Behavior Design"
 
You shouldn't need to set the leader itself - the behavior tree will do that for you. I would create a new project and follow the deathmatch videos for creating a new scene just to get it working. From there you can transfer it to your existing project. There is a find button on the top right of the editor.
 
Top