Hi,
I have a really weird thing happening, and I can't seem to find out the reason. I believe I have the logic set up correctly, but the result suffers from a mysterious bug. Maybe you can help me resolve this?
Set Up:
I have a Monobehavior Script Class that creates a SphereCollider and sets isTrigger=true in the OnAwake() function.
I have a BehaviorTree(external behavior tree) that has a Conditional OnTriggerEntered running on a Sequence with abort type= both.
Expected Result:
The character is spawned in the scene, and makes his own Trigger in the first frame. This registers the OnTriggerEntered() callback...so the Behavior should fire that when entered from then on.
The Sequence abort type=both should make this condition re-evaluate WHENEVER it happens, regardless of the branch it's currently executing.
Result:
This is completely ignored when I first load the scene programmatically. The OnTriggerEntered conditional is always failed, even though the character has a trigger.
When I switch to the Scene view and select the character in the editor while in PlayInEditor mode...suddenly everything works perfect!!
I can't really debug this...because when I select the character, everything works perfectly. And before that, I can't see the BehaviorTree running (because the character is not selected). Kind of a chicken-or-the-egg problem...
What I've tried:
I thought maybe it was an order-of-script-execution thing...maybe the trigger doesn't exist yet when the OnTriggerEntered conditional is registered?? And so it doesn't know about it?
I've tried to Disable/Enable the BehaviorTree to 'reset' it...thinking somehow it was reset by me 'selecting' the character in PlayInEditor mode...and I could emulate this behavior AFTER creating the Trigger.
No dice.
Questions:
What can you tell me about this?
Is there difference between triggers created and serialized in the Editor vs created at runtime?
Is there a way to explicitly register the Trigger and OnTriggerEntered conditional to know about each other at runtime?
What could be happening in PlayInEditor mode when I select the GameObject with the BehaviorTree? How can I re-create this at runtime (without the Behavior Designer View, of course...but just whatever "reset" logic is happening, because that WORKS!).
Here's the top of my BehaviorTree....BlockingAction is always false, and the IsCalm? branch is always evaluated (until I select the GO in Editor)...
I have a really weird thing happening, and I can't seem to find out the reason. I believe I have the logic set up correctly, but the result suffers from a mysterious bug. Maybe you can help me resolve this?
Set Up:
I have a Monobehavior Script Class that creates a SphereCollider and sets isTrigger=true in the OnAwake() function.
I have a BehaviorTree(external behavior tree) that has a Conditional OnTriggerEntered running on a Sequence with abort type= both.
Expected Result:
The character is spawned in the scene, and makes his own Trigger in the first frame. This registers the OnTriggerEntered() callback...so the Behavior should fire that when entered from then on.
The Sequence abort type=both should make this condition re-evaluate WHENEVER it happens, regardless of the branch it's currently executing.
Result:
This is completely ignored when I first load the scene programmatically. The OnTriggerEntered conditional is always failed, even though the character has a trigger.
When I switch to the Scene view and select the character in the editor while in PlayInEditor mode...suddenly everything works perfect!!
I can't really debug this...because when I select the character, everything works perfectly. And before that, I can't see the BehaviorTree running (because the character is not selected). Kind of a chicken-or-the-egg problem...
What I've tried:
I thought maybe it was an order-of-script-execution thing...maybe the trigger doesn't exist yet when the OnTriggerEntered conditional is registered?? And so it doesn't know about it?
I've tried to Disable/Enable the BehaviorTree to 'reset' it...thinking somehow it was reset by me 'selecting' the character in PlayInEditor mode...and I could emulate this behavior AFTER creating the Trigger.
No dice.
Questions:
What can you tell me about this?
Is there difference between triggers created and serialized in the Editor vs created at runtime?
Is there a way to explicitly register the Trigger and OnTriggerEntered conditional to know about each other at runtime?
What could be happening in PlayInEditor mode when I select the GameObject with the BehaviorTree? How can I re-create this at runtime (without the Behavior Designer View, of course...but just whatever "reset" logic is happening, because that WORKS!).
Here's the top of my BehaviorTree....BlockingAction is always false, and the IsCalm? branch is always evaluated (until I select the GO in Editor)...