Behavior graph Navigate to player


I have two graphs, the first is the main brain and the second is for combat scenarios.
In graph A, the agent will chase the player till it reaches a threshold, which it then transitions into the combat state.

In graph b, I just have a navigate to player node attached to on start.

The issue is that the agent does not continue to navigate towards the player once it entered the subgraph. In play mode, the agent stops a distance away from the player and only continues to navigate to the player after I input movement. It shows the in progress symbol, but does not execute the behavior.

Hi @relzarick

Could you please provide the tree above the RunInParallel? This symbols means the nodes were Interrupted (nodes were stopped before finishing by an external control node, such as Restart or Abort).

This might be caused by a condition above.

Thanks for replying. @MorganHoarauUnity


At the very top of this tree is a On Player Spotted event.


The sub graph runs after the event is called and sets my Enum to abort any unwanted behaviors.

The logic here is ran in the subgraph. What I was expecting was for the agent to continue its navigation towards the player. There is the in progress symbol but no actual movement

In
Given the screenshot provided, when you enter the Combat tree, you set CurrentState to Combat.

This causes the “Abort If”, at the top of your Chase tree, to cancel execution of all its children (including the “Self navigates to Player”).

But give your last screenshot, the “Template Combat Graph” does call Navigate To Target when it starts. Is that right?
If so the issue might lies in the Blackboard Variable in your subgraph (either Self or Player).

You can debug them by using Log Variable before the navigation node in the subgraph.

Thanks for the reply @MorganHoarauUnity.


Just to clarify, the behavior in the subgraph does run, but only after I input movement. (specifically the navigate to player node)


The variables are all correct and the console logs it the moment the graph runs.

In that case, it could be a timing issue. The navigation node relies on the agent’s NavMeshAgent. What might be happening is:

  1. The subgraph starts navigating to the player and configures pathfinding.
  2. Shortly after, the parent graph is aborted (one frame later), which cancels its navigation.
  3. This abort resets the NavMeshAgent path, interrupting the subgraph’s navigation.

To test this hypothesis, try adding a “Wait 1 second” node before the subgraph navigation begins. This will give the parent graph time to abort first, ensuring the new navigation in the subgraph isn’t immediately overridden.

oh wow, I cant believe the solution was so simple. Thank you so much