Walking/Moving animation for NPC (following set path and waiting for player) isn't working properly

Hello everyone, I am currently struggling while working on a scene where a little square is supposed to show the way to the player - I have been able to implement a working code which makes the square wait for the player if they are too far away.

When waiting, the idle animation is playing without problems. When the player comes near enough and the square is supposed to move to its first waypoint, the walking animation doesn’t look the same as in the animator window.

Instead, it moves forwards a little and then (smoothly) back to its original starting point. I have ticked “Loop Time” in the inspector of the walking animation. I am really unsure what exactly the problem is and I would immensly appreciate any help, as I wasn’t able to find any solutions via the internet or chatGPT.

Since I am not able to upload any attachments yet, here is a link to a drive folder where I put the screen recordings of my problem :slight_smile:
Let me know if you need any more information!

https://drive.google.com/drive/folders/1EAnp7gKFj69rqBI3OmkbYHb2E3hRWGyX?usp=sharing

I am looking forward to any responses! <3