Reply To: Help setting anim parameters

NodeCanvas Forums Support Help setting anim parameters Reply To: Help setting anim parameters

#12098
Gavalakis
Keymaster

Hello and sorry for the late reply.
It is really fine to do it within Behaviour Trees similar to what you are doing now.
One thing I usually suggest as well for Animator Parameters, is to make use of Data Bound Variables and create a simple script with properties to bound variables to, acting as a bridge.
For example, you can have a script like this attached on the same gameobject as the Blackboard and GraphOwner is:

Then you will be able to bind a blackboard variable directly to this property and as such, whenever you set the blackboard variable, the property setter will be called whereas whenever you get the blackboard variable, the property getter will be called.
This way, you can completely avoid using the Mecanim based Actions, but instead get/set the variable (thus the property and thus the animator parameter) quicker and easier.
BoundVariable

You can of course expand this script adding more properties for more parameters.
Let me know if that helps or if you have any other questions.
Thanks!

Join us on Discord: https://discord.gg/97q2Rjh

Attachments:
  1. BoundVariable.png