Making a 2d sprite play its animation at given waypoint.

Hello, everyone.
I’m still quite a beginner in coding.

I’m trying to make 2.5D like game as a practice project.

I’m trying to get my 2d sprite character idle animation to play after its moving animation done reaching to the given way point.

This is the code I’ve done so far:

public Transform[] points;

private int destPoint;

private NavMeshAgent agent;

private Animator anim;

bool _isWalkingUp = false;

const int STATE_IDLEFRONT = 0;
const int STATE_WALKFRONT = 1;

	void moveThere()
	{
		if (_isWalkingUp == false) {

			agent.destination = points [0].position;
			changeState (STATE_WALKFRONT);
			_isWalkingUp = true;

		} else if (_isWalkingUp == true) {
			changeState(STATE_IDLEFRONT);
		}


	}
	

	void changeState(int state){
		if (_currentAnimationState == state)
			return;
		switch (state) {

		case STATE_IDLEFRONT:
			anim.SetInteger ("state" , STATE_IDLEFRONT);
			break;


		case STATE_WALKFRONT:
			anim.SetInteger ("state" , STATE_WALKFRONT);
			break;

		}
		_currentAnimationState = state;
	}

Its on this part here where my character does its front move animation and then reaches its waypoint but my idle animation doesn’t play it from there. Even the debug.log there is a no show. Can anyone help me?

if (_isWalkingUp == false) 
{
             agent.destination = points [0].position;
             changeState (STATE_WALKFRONT);
             Debug.Log ("Walking There");
             _isWalkingUp = true;
 
         } else if (_isWalkingUp == true) {
             Debug.Log("Meow");
             changeState(STATE_IDLEFRONT);
         }

}

I think you’re missing a like to set _IsWalkingUp back to false.

Debug.Log("Meow");
changeState(STATE_IDLEFRONT);
_IsWalkingOn = false;