How to make squash and stretch a ball at runtime

Hey I just wanted to know how you got shapes like this ?