Well I dont know how you have written this at the moment but I assume you have an animated character set up? I will assume below that there is a character with four animations which i will call AniLeft, AniRight, AniUp, AniDown. Obviously you will need to change it to suit what you have named your animations.
Func process(delta):
var vel = vector2.zero
if input.isactionpressed("uileft"):
vel.x += 1
if input.isactionpressed("uiright"):
vel.x -= 1
if input.isactionpressed("uiup"):
vel.y -= 1
if input.isactionpressed("uidown"):
vel.y += 1
moveandslide(vel.normalized() * 100)
personalAnimationControl(vel)
func personalAnimationControl(vel)
if vel.x > 1:
$"AnimatedSprite".play("AniRight")
elif vel.x < 1:
$"AnimatedSprite".play("AniLeft")
elif vel.y > 1:
$"AnimatedSprite".play("AniDown")
elif vel.x < 1:
$"AnimatedSprite".play("AniUp")
else:
$"AnimatedSprite".stop
$"AnimatedSprite".frame = 0
so the above shouldnt cause the problem you are seeing at least but I dont know how different that is from your code?