OnFixedUpdate is not called for subclass if it's not overridden

mmorsi

New member
Hi,
We have found a bug that is related to OnFixedUpdate not being called if it's overridden in the parent class but the subclass.

Description:
If we have class A that overrides OnFixedUpdate, then class B inherits class A without overriding OnFixedUpdate.
If in the behavior tree, we use class B as a node. The method OnFixedUpdate from the parent class (class A) is not called.

If we want it's to be called, we have to do one of the following:
1. Override OnFixedUpdate again in class B and call base.OnFixedUpdate()
2. Have a node that is on the same hierarchy-level as class B on the behavior tree that has an overridden OnFixedUpdate

Here is a description of the bug with examples (classes, behavior tree design, console log)
findings.png

This is not a blocker to our work, but we must do a small hack to get it working (method #1). We wonder if this is indeed a bug or if there are additional settings that we need to do.

Thanks,
 
Behavior Designer uses reflection when the tree loads to determine if the method needs to be called. It doesn't look like this reflection is taking into account the parent classes. I will take a look for the next update. For right now you can also download the runtime source and remove this if condition within the BehaviorManager:

Code:
                if (behaviorTrees[i].behavior.HasEvent[(int)Behavior.EventTypes.OnFixedUpdate]) {
 
Back
Top