OnUpdate not called but graph shows task running?

nRedux

Member
I am having a problem where the graph appears to have my custom action task running but it's OnUpdate method isn't called after the first time. Oddly, this didn't happen until recently after having not changed anything in the graph/task. Any ideas?

State running.PNG
 
Don't you need a repeater task if you use the OnUpdate method? You have a repeater on your right side but not on your left side.
But I haven't used BD in a long time and maybe he changed the way that works, so I could be wrong.
 
Is your task returning a status of running? I haven't seen this occur before so it is likely something that is specific to how the task is setup. If you disable that task does the wait task get its OnUpdate called?
Don't you need a repeater task if you use the OnUpdate method? You have a repeater on your right side but not on your left side.
But I haven't used BD in a long time and maybe he changed the way that works, so I could be wrong.
That could be it, but based on the context my guess is that this task returns a status of running so it doesn't need a repeater to have it call OnUpdate again.
 
Yeah if I disable that action, the wait action executes normally. Only my task is hanging.
 
Last edited:
If you switch that task with one that just returns a status of running does OnUpdate get called? It is looking like something specific within that task is preventing the update.
 
The following task has it's OnUpdate called as normal every frame. Not sure what's wrong with the other task I pasted originally. Any idea? Seems ok.

Code:
    [TaskDescription("Changes the movement goal/strategy set of the agent")]
    [TaskCategory("Resonance/Test")]
    public class TestAction : Action
    {
        public override TaskStatus OnUpdate()
        {
            Debug.Log("Running");
            return TaskStatus.Running;
        }

    }
 
If I disable and re-enable the tree during play (via inspector enabled checkbox on the BehaviorTree component) it behaves as it should with OnUpdate being called each frame.
 
Any idea what could cause an task not to have it's update method called? Did you have a chance to browse the task code?
 
I stripped my task down to nothing but the update method returning "running" and it still hangs in the same fashion o_O. Is it possible the graph is broken? I should have mentioned that the parallel selector and everything below it is in an external behavior tree. Is that somehow involved or problematic? As mentioned before this used to work and suddenly stopped.
 
Wait.. could it be that I don't set finished to false in OnReset? Does state persist between playthroughs in the tasks?
 
Wait.. could it be that I don't set finished to false in OnReset? Does state persist between playthroughs in the tasks?
[edit]No I see OnReset isn't used like that. I overrode OnBehaviorRestart and reset variables which might be of concern but it didn't help anything.
 
I stripped my task down to nothing but the update method returning "running" and it still hangs in the same fashion
So what is the difference between the stripped down existing task and the new task that you tried which just returned the status of running? If you enable logging on the behavior tree you'll be able to see a text representation of what the behavior is trying to do.
Wait.. could it be that I don't set finished to false in OnReset? Does state persist between playthroughs in the tasks?
OnReset is only called by the editor so I don't think so.
 
Top