Using Blend Trees, I want to switch smoothly based on input, but my input is simulated. How can I achieve this?

I’ve seen this topic discussed a few times before, but no one really seems to provide a solid answer to it.
Here’s my own take and problem: I’ve got three control states - (-1, 0, 1). -1 is backwards, 0 is idle, and 1 is forward.

Initially, I just used a direct button press. Down = 1, up equaled -1, and states between caused idle to occur. That required somewhat of a complex animation tree, with ineffectual smoothing between animation states.

Now, I have started using Blend trees - however, direct switching between the three states causes abrupt animation changes. I’d like to smooth that out, but I’m not sure of the best way to do so.

This is what I have come up with so far:

private void PlayerControlSystem()
{
    if (ControlKeysPressed)
    {

        ControlSwitch = Mathf.Lerp(ControlSwitch, 1, 0.1f * Time.deltaTime);
    }
    else
    {
        ControlSwitch = Mathf.Lerp(ControlSwitch, -1, 0.1f * Time.deltaTime);
    }
}

It partially works, but has some problems such as when it hits zero it should idle, but keeps trying to walk/run as the value itself is actually 0.4456457f (to infinity). I’d like to create a quick and smooth tween between animations instead and it properly stops when the controls are at correct values.

How can I accomplish this?

So you have an animation controller for your player and have a transition between Idle and Walking.
Click on that transition and in the Inspector the will be settings. Grab and drag the blue bar on the timeline all the way to 0:00. If that doesn’t work, uncheck Has Exit Time.

Got it! Okay, so I was on the right track, but I had to add in some additional locks to prevent undesired movement beyond some basic conditions. Essentially, I had one method that was overriding the others, even though it appeared to be 0 it was just changing to fast for me to see.