Animation while walking

I have a script to move my character (2D) , but I want to animate him so when he walks it plays animation. Please give me a simple script I am kinda of new in scripting, Thanks. :smiley:

Use… gameobject.Getcomponent().Play(“Your Walking Animation name”); OR gameobject.Getcomponent().CrossFade(“Your Walking Animation name”);