How to animate player while using touch inputs

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Help me please

I am using kinematic body and animated sprite and collision shape as its child. And i am moving player with touches as in 2d movement overview (click an move)from here i am able to move my player with touches but am stuck in its animation. Please send me a piece of code and its explaination.

:bust_in_silhouette: Reply From: Help me please

I got my answer!
just needed to compare velocity.x with velocity.y