Character shaking function