Has Entered Trigger Conditional Evaluator not passing

BrickyT

New member
I am having trouble getting a Conditional Evaluator to succeed/fire. I have a Conditional Eval that is waiting for the car ("Player" tag) to enter the trigger collider but it isn't triggering when the car enters.

I have the tag "Player" set on the car "fiesta_wagon". I'm not sure I need both the tag and the object but removing one or the other doesn't work either.

Any ideas on what is wrong here or how I could detect collision in BD better?

End goal is to have the car hit the Agent AI and call Die ability to start ragdoll and then despawn the character once they've been on the ground for a beat.

Any help is appreciated, cheers!unknown.png
 
Last edited:
If you are using a trigger then you will need to execute that with the conditional abort. The reason for this is that OnTriggerEnter happens outside of the ConditionalEvaluator execution so it is never caught.
 
Thanks Justin! I still am having trouble with the conditional abort concept. I've watched the video
and read over the documentation https://opsive.com/support/documentation/behavior-designer/conditional-aborts/ but still not understanding how it makes a difference in firing the conditional evaluator after tinkering; selecting self, lower priority or both doesn't seem to change the behavior in my example. Maybe I have the behavior layout incorrect? How should I setup a behavior that pursues an object when it sees it and when it gets close triggers the die ability?

If that is too much hand-holding, no worries, can you explain more what you mean by " outside of the ConditionalEvaluator execution" in your statement above? That might be my key to understanding the behavior.

Appreciate your assistance. Loving BD so far!
 
So I *think* I understand how the conditional abort should be used BUT I am still not passing the conditional evaluator when the car enters the trigger.

Am I still not setting up the conditional abort correctly?
or
Is my Conditional Evaluator setup incorrectly?
or
both are setup correctly?

Thanks so much for any advice or tips!

1654788748600.png
 
The ConditionalEvaluator runs the conditional task in the following order:

OnStart
OnUpdate
OnEnd

The trigger is then triggered outside of the OnEnd so the callback won't be received. Conditional aborts change that because it keeps the conditional task reevaluating so the trigger can be captured. Your behavior tree could be structured as:

Sequence (lower priority abort) Pursue
HasEnteredTrigger Die

Am I still not setting up the conditional abort correctly?
or
Is my Conditional Evaluator setup incorrectly?
The conditional evaluator is a decorator so it is not reevaluated. With conditional aborts you should use a regular conditional task instead of the evaluator.
 
Hello Justin! I got the Sequence working with your suggestions!

But I am still not able to get a conditional based on collision or triggers or even distance to work, so wondering if you could help me some more?


The Within Distance task is looking for a tagged game object on the hood of the car but as you can see in the video, the task is not passing when the AI Agent gets within distance of the game object. Furthermore, if the car drives into the agent the task fires briefly but doesn't "succeed" as the log isn't created.

I assume there is a problem with the car but I don't understand what it could be or what specifically the BT tasks need to reference to succeed so hoping you can't point me into the right direction here. Thanks so much! Cheers!
 
None of the tasks are being reevaluated. You should change your lower priority conditional abort to self.
 
Thanks for the help Justin! Really appreciate it! I assume that I have to change the tree structure to use Self, as I changed it (from Lower Priority) on the Sequence task and now the Pursue task is only running once.

I am tinkering with the tree, trying different things, and have rewatched the video on Conditional Aborts
a couple of times, I'm sorry that I'm still not fully 'getting it' and would appreciate the help!

1655216901234.png
 
In that last image the reason why Can See Object isn't being reevaluated is because no task to the right of it (parallel/ within distance/log) is active. You have a repeater though so the tree will restart each frame. I recommend having an idle task just to keep the tree active. This video has another example of conditional aborts:

 
Thanks Justin! I put the idle as suggested to the right of the parallel / within distance / log but the sequence is still failing at parallel.
1655318343829.png
I maybe have misunderstood
because no task to the right of it (parallel/ within distance/log) is active. You have a repeater though so the tree will restart each frame. I recommend having an idle task just to keep the tree active.
so I put the Idle in other positions along the sequence and that also didn't provide the desired results of triggering the parallel and within distance.

Thanks for the video, I thought I had a good handle on the left to right logic but how that is changed when Conditional Aborts are used is proving difficult for me to grasp.

Appreciate the help and apologies this is like pulling teeth. I understand at some point you need to do better things with your time than spoon-feed me this concept but I truly appreciate all the time you've given me thus far. Cheers!
 
To simplify this you can add a collider to the front of the vehicle with an insta kill script, enable the collider at > x speed and disable if < x than speed. That's how I have previously handled this, and I will add it to my board asset
 
Are you sure that Can See Object should succeed? You are repeating it every frame so my guess is that one of the Can See parameters is causing it to fail when you'd expect it to succeed. There is a debug parameter on the task which has a debug line indicating the reason why the task failed.

Conditional aborts don't have to be used but they make things a lot easier once you have an understanding of how they work. The self abort type reevaluates the conditional tasks within the branch when a child task is active. The lower priority abort reevaluates the conditional tasks within hte branch when a task within a branch to the right is currently active.
 
To simplify this you can add a collider to the front of the vehicle with an insta kill script, enable the collider at > x speed and disable if < x than speed. That's how I have previously handled this, and I will add it to my board asset
Thanks FastSkill! I have some questions about this, I'll talk to you on Discord.

Are you sure that Can See Object should succeed? You are repeating it every frame so my guess is that one of the Can See parameters is causing it to fail when you'd expect it to succeed. There is a debug parameter on the task which has a debug line indicating the reason why the task failed.

I played around with the Can See Object task parameters and I got it to pass by Disabling Agent Collider Layer, I am confused by this though because the collider layer isn't impacting POV.

Either way, I am still not getting Within Distance to trigger except when I drive into the agent for a few moments. Here is a video to show that situation and the Within Distance parameters.


1655406380810.png
I'm glad I am learning about Conditional Aborts, no doubt they will be useful when I master them but I'm still back to the original question/situation of Within Distance not firing as expected when the car game obj "Hood" is in range. Here is the Hood game object for reference.
1655406537057.png

Still tinkering away with this but just stumped as to why the Within Object task isn't picking up this specific game obj. It is probably something very simple that I am missing...

Appreciate all the help! Cheers!
 
Your Within Distance task isn't running when Pursue is active so that's why it doesn't trigger. Notice the task isn't green nor is there a circle around the execution status of the conditional task. If you move Within Distance to the left of the Parallel then it will reevaluate.

But I don't think that is your intention. Pursue isn't going to return success unless the agent arrives at the car's position which is never going to happen because of the colliders. Instead you should restructure your tree similar to:

Code:
                                          Sequence (Self, as you have)
Can See                          Parallel Selector                                Log
                             Repeater                     Parallel
                        Within Distance        CrossFade   Pursue

The Parallel Selector task will return success as soon as the Within Distance task returns success. I would need to test this to verify that it works as I am thinking but it should at least get you one step closer.
 
Thanks Justin. I'm not sure if I setup the tree as you described but it looks like the Can See Obj is running once, failing and then the rest of the Sequence isn't running. My understanding is I need to check the Can See Obj on every frame but if I add a repeater before the Can See Obj I believe I am running into the Conditional Abort.

I'll tinker more tonight to see how I can get this working but my concern is that since you told me how to set the tree up and it isn't working that there are more things wrong with my setup.

Thanks so much for all your help!

1655499629892.png
 
Your setup looks good, just make sure you attach a repeater to the top like you had originally and that'll allow the tree to continue to execute.

I haven't tested this setup so there may still be some tweaks required but it should get you one step closer.
 
Making progress! Can See Obj is passing and being reevaluated every frame but the next part of the sequence, the Parallel Selector isn't being triggered. Any ideas on why this is the case? I am tinkering but I can't get the next task on the sequence to trigger even if I remove the abort conditional (for example).

Thanks so much for your continued help. Hope you are feeling better!
 

Attachments

  • canseeobj.gif
    canseeobj.gif
    367.9 KB · Views: 7
When Can See Object returns success it will move onto the next task. It doesn't look like it is getting the opportunity to do so. As a test if you remove the conditional abort at the top does it work?
 
I removed the Self conditional abort from the Sequence task and getting the same results. Can See Obj is being reevaluated every frame but when it passes the sequence doesn't move to the Parallel Selector.
 
I am not sure why that is occurring. Can you reproduce it within a small repro scene so I can take a look?
 
Top