Conditional Task by using OnFixedUpdate

There are two ways that you can accomplish this:

1. If you want all of your tasks to execute within FixedUpdate you can manually tick the Behavior Manager within the FixedUpdate loop.
2. If you only want a single task to use FixedUpdate you can override OnFixedUpdate as you mentioned, and then store the results in a private variable. You can then return these results within OnUpdate. You'll need to do it this way since the rest of the tree updates within the Update loop.
 
There are two ways that you can accomplish this:

1. If you want all of your tasks to execute within FixedUpdate you can manually tick the Behavior Manager within the FixedUpdate loop.
2. If you only want a single task to use FixedUpdate you can override OnFixedUpdate as you mentioned, and then store the results in a private variable. You can then return these results within OnUpdate. You'll need to do it this way since the rest of the tree updates within the Update loop.

Thanks for the reply.
Actually I have implemented your second option but also I was using Conditional Abort and as I noticed, just OnUpdate works when Conditional Abort is active. (OnFixedUpdate and OnStart just works for a first entrance)
 
Ah, yeah, with conditional aborts from OnUpdate you could call OnFixedUpdate to update the logic. A regular OnUpdate is running in between OnStart/OnEnd, and the conditional abort is occurring when outside those methods.
 
Ah, yeah, with conditional aborts from OnUpdate you could call OnFixedUpdate to update the logic. A regular OnUpdate is running in between OnStart/OnEnd, and the conditional abort is occurring when outside those methods.

So then, OnFixedUpdate is actual FixedUpdate ? Because by calling OnFixedUpdate in OnUpdate, its execution is not in Update frames ?
 
OnFixedUpdate is within FixedUpdate. If you call OnFixedUpdate within OnUpdate then it will be within the Update loop. There isn't a way to have conditional aborts run within the FixedUpdate loop unless you tick the entire tree within FixedUpdate.
 
OnFixedUpdate is within FixedUpdate. If you call OnFixedUpdate within OnUpdate then it will be within the Update loop. There isn't a way to have conditional aborts run within the FixedUpdate loop unless you tick the entire tree within FixedUpdate.

Yup, I have noticed but you don't think Behavior Designer needs this feature ? Because there are Conditionals which must be executed within FixedUpdate loop like Raycast.
 
Yes, that is a good use case for being able to return a status within the Fixed Update loop. With the behavior tree not ticking within Fixed Update though it makes it a bit more difficult. This is a bit in the future but for version 2 I am planning on testing to see how not returning a status within the OnUpdate loop works and having to end the tree by calling a function. This should give you more flexibility for when the tree ends.
 
Top