Help setting anim parameters

NodeCanvas Forums Support Help setting anim parameters

This topic contains 1 reply, has 2 voices, and was last updated by  Gavalakis 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12090

    yulaw2k
    Participant

    1

    Is this how you check a value and set it on like an update function? In a script I would just get velocity and set the mechanim parameter on every update, and I am trying to find a proper way to do this through behavior trees. Do you think something like this should be done in trees? or should it be done through code.

    2

    You can see in this pic, the name is exactly the same, RunSpeed. But its never set, it never changes from the behavior tree. How come?

    Attachments:
    You must be logged in to view attached files.
    #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!

    Attachments:
    You must be logged in to view attached files.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.