How to do an animation transition

I’m using a 3D avatar made using Blender and it has two animations: the idle animation and another one. I want to trigger the second animation when the value of a slider is below a number, and go back to the idle animation when the value of the slider is above that number.

I have assigned an animator to the avatar, and I have created a trigger to use it in the transition.

I have written this code, but when the program starts, it doesn’t start with the idle animation (although the slider begins with value 100 and decreases over time).

Animator anim;
public Slider barraDiversion;

void Start()
{
    anim = GetComponent<Animator>();
}

void Update()
{
    if (barraDiversion.value <= 50)
    {
        anim.SetTrigger("IrAburrido");
    }
}

In the Animator window, you can set the default animation there to Idle.

I would also change this line:

anim.SetTrigger("IrAburrido");

to this:

anim.SetBool("IrAburrido", true);

Maybe I use them wrong, but I have had a ton of trouble with SetTrigger in the animator and have much more control and success with bools.

Did you set up the bool in Animator, with the arrow things