I imported a walking animation from Mixamo to make custom enemy.but then snaps back to its original position, and keeps repeating this cycle.

Firstly, when exporting from Mixamo, if you choose “InPlace” down the bottom (and make sure it’s a looping animation) then it might be easier to use.

That said, I assume this particular animation is snapping back to it’s real position as per the earlier reply. Here is the documentation which explains exactly what causes that phenomenon:

^^
The jumping-forwards animation, in particular.

IIRC, In Root Motion: you can choose “Force Root Lock”… but there is also plenty of guidance in this linked article also.