2d game,Moving a character according to the animation, rather than code

I’m using native 2d tool, export character’s sprite into the game moving,and edit it in animation tool, charactor will move forward in each frame.I expected this to mean that the character will move in Unity.but it doesn’t

My character will move forward for a second, from 0,0,0 then the character snaps back to 0,0,0 once the animation ends.

Is there a way to change the position of the character according to the animation, without something like script?

No, that’s not how animation works. You’ve got a static image that just has pixels in different places each frame, to create the illusion of movement there. You’re taking a very tedious approach to moving your character. Simply use some movement code to move the character around, whether that be with a rigidbody, or just through translation movement if that kind of limited movement is fine for your game. It might seem more complicated, but it’s really more simple actually.

You can also create an animation in Unity that moves the character around, and with “Apply Root Motion” checked, it will keep it from going back to where it started, and instead repeat the movement from where it ended.