Changing the values of AnimationNodeTransition parameters

Godot Version

Question

I’m trying to change the parameters like this:

public void onChangeState()
{
        GD.Print(at.Get("parameters/MoveState/hasWeapon/current_state"), c.isCrouching);
        if (c.holdingWeapon)
        {
            at.Set("parameters/MoveState/hasWeapon/current_state", "has_weapon");
            if (c.isCrouching)
            {
                at.Set("parameters/MoveState/isCrouchingGun/current_state", "is_crouching");
            }
            else at.Set("parameters/MoveState/isCrouchingGun/current_state", "not_crouching");
        }
        else
        {
            at.Set("parameters/MoveState/hasWeapon/current_state", "no_weapon");
            if (c.isCrouching)
            {
                at.Set("parameters/MoveState/isCrouchingGun/current_state", "is_crouching");
            }
            else at.Set("parameters/MoveState/isCrouchingGun/current_state", "not_crouching");
        }
}

However, the parameters won’t change. I also tried with indexes, but it also doesn’t work. Changing other parameters, such as blenTree’s values works correctly.

How can I change the values of the parameters in the AnimationNodeTransitions?

You need to use the transition_request property as shown in the documentation of the AnimationNodeTransition For example:

at.Set("parameters/MoveState/hasWeapon/transition_request", "has_weapon");

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.