Animator - Set Bool Parameter

Craze

New member
Hello everyone !

I have been encountering an issue and I am not sure what to do, I looked for solutions but no one seems to have encountered this issue before.

I have a really simple behavior tree with just a single task 'Set Bool Parameter', referencing to a gameObject with an animator, and inside a parameter 'isAiming' bool that I would like to control through the behavior tree.

When I launch the tree, the function returns success but when I check in animator, my parameter bool still has not changed, and I also get this message in the console : "Animator is not playing an animationController, UnityEngine.Animator:GetBool(Int32)"

I am using an animation controller that I created earlier, and does has the corresponding parameter.
Is there something I am missing ?

PS : I am using the behavior tree as a external behavior tree. When I try that not using an external behavior tree, is just works...

Thanks !
 

Justin

Administrator
Staff member
That error generally means that the animator isn't enabled or an animator controller isn't set at the time the task runs. If you add a wait task so the set bool task is delayed then that should give the animator time to initialize.
 

Justin

Administrator
Staff member
As soon as the external behavior tree is consumed it shouldn't make a difference. Is the animator reference pointing to the correct GameObject?
 

Craze

New member
As soon as the external behavior tree is consumed it shouldn't make a difference. Is the animator reference pointing to the correct GameObject?
It is yes, I am going to try to make it a shared variable to see if that's the issue
 
Top