object ai following, idle animation and pathfinding

To the moderator dont close this question for asking help or code or anything off topic. i want to see if anyone can help me

hi, i have a player and a floating gameobject(something like a flying gadget).
well, i also made an animation for the gadget, the animation is simple, in the animation it just fly to a door, to help the player find way to the next round.
there is 2 animation.
idle(just stay still with a little motion to make it looks loke it is flying)
pathfinding(where the gadget help to find the door)

so here is my question, when my gadget is going too far(with pathfinding animation) and the player is unable to catch with it, i want to make that animation pause and play the idle animation. and when the player is near it will resume the pathfinding animation, maybe adding a collider to the gadget so if the player collide it will stop the idle anim and resume the pathfinding animation.

so how do i do that?? i mean swithing the animation without stop the pathfinding animation(only pause until the player is able to catch up)?

make a bool in update. Only move the object when the bool is in x state (true/false whatever). Then use something like Vect3.dist to monitor the players distance from the goal object. If it’s greater then you want stop the animation. If not play the animation. There are better ways to do this sort of thing but that is the fix as you asked for it.

well instead of using animation i searched a bit and got it with itween path.
i am closing this thread thanx for help