Patrol isn't working correctly & Speed Change ability doesn't active

bluebird

Member
Hi @Justin

1) I observed AI agent doesn't follow waypoints even if 'Patrol' task returns true.
Instead of following waypoints, agent walk on straight path on random direction. (In below shot, agent is blocked by cube but the walking animation still run)

I can't identify what should be the cause behind this problem!

2) Other problem is agent's 'Start Stop Ability' (Speed Change) task returns true but the agent doesn't run!
I want AI agent to run and chase the target when target enters into agent's region.
(I noticed that 'Nav Mesh Agent Movement' ability active, but 'Speed Change' doesn't active)

3) This is error is about Behavior Designer editor:
When I open the unity project every time, I need to re-assign waypoint objects into 'Patrol' task inspector.
 

Attachments

Justin

Administrator
Staff member
It looks like you are referencing scene objects from a project level asset:

 

bluebird

Member
It looks like you are referencing scene objects from a project level asset:

3) I've assigned external behavior tree into AI agent.

I've gone through the link.
I also tested, If we want to assign single variable runtime, then it's possible using this way, but it doesn't work with multiple waypoints game objects.

b'coz in 'Find' task, we can't set 'GameObjectList' type variable into 'Store Value' field!
 

bluebird

Member
Hi @Justin

1) I observed AI agent doesn't follow waypoints even if 'Patrol' task returns true.
Instead of following waypoints, agent walk on straight path on random direction. (In below shot, agent is blocked by cube but the walking animation still run)

I can't identify what should be the cause behind this problem!

2) Other problem is agent's 'Start Stop Ability' (Speed Change) task returns true but the agent doesn't run!
I want AI agent to run and chase the target when target enters into agent's region.
(I noticed that 'Nav Mesh Agent Movement' ability active, but 'Speed Change' doesn't active)

3) This is error is about Behavior Designer editor:
When I open the unity project every time, I need to re-assign waypoint objects into 'Patrol' task inspector.
Regarding question #2,

I unchecked 'Always Returns Success' and now 'Start Stop Ability' task returns false.
Any idea, why ability doesn't start?
 
Last edited:

Justin

Administrator
Staff member
Instead of using the Find task I would create a new component and assign the re fences manually using BehaviorTree.
SetVariableValue. This is what I did with the Deathmatch AI Kit and it is the quickest method since Find is slow.

I unchecked 'Always Returns Success' and now 'Start Stop Ability' task returns false.
Any idea, why ability doesn't start?
The best way to determine why something isn't starting is to place a breakpoint within StartStopAbility.OnUpdate and step through the logic to determine where it is ending early.
 

bluebird

Member
The best way to determine why something isn't starting is to place a breakpoint within StartStopAbility.OnUpdate and step through the logic to determine where it is ending early.
I tried, dubgging the code inside StartStopAbility.OnUpdate() method and came to know that 'abilityStarted' returns false.
C#:
if (m_Start.Value) {
    var abilityStarted = m_CharacterLocomotion.TryStartAbility(m_Ability);
    return (abilityStarted || m_AlwaysReturnSuccess.Value) ? TaskStatus.Success : TaskStatus.Failure;
}
1538
 

Justin

Administrator
Staff member
You'll need to keep stepping into the methods until you find the lowest level conditional code that is returning false. There are a lot of conditions within TryStartAbility that can cause an ability not to start.
 
Top