The proper way to Get Bool parameter from the animator

MBun

New member
Hi,

I'm having difficulty to understand the proper syntax to get a bool from the AI's animator.

On Base Layer, I have a bool called Attack which is set through a script. I want to get and expose the result in a BD's shared bool.

In the animator :
1607868696331.png

In BD :
1607868753041.png


In Parameter Name, I first simply tried Attack and the Base Layer.Attack, but I still get this warning and nothing is passed to the Shared bool Attack.
C#:
Parameter 'Base Layer.Attack' does not exist.
UnityEngine.Animator:GetBool(String)
BehaviorDesigner.Runtime.Tasks.Unity.UnityAnimator.GetBoolParameter:OnUpdate() (at Assets/Behavior Designer/Runtime/Tasks/Unity/Animator/GetBoolParameter.cs:36)

I can still set the shared bool throught script, but I am curious. What am I missing? Thanks for any help.
 
Based on your screenshot you should use Attack. Parameters are not attached to a specific layer so you don't want to include Base Layer.Attack. GetBoolParameter just calls Animator.GetBool on the SharedVairable:

Code:
animator.GetBool(paramaterName.Value)
 
Top