When that has happened to me I just unscrewed the drain screw in bottom of the bowl, and hoped that any foreign object that might be messing with the floats would come out with the gas. I think draining the gas in the float bowl also allows the float to quit floating, creating float movement...just like hitting it with a hammer accomplishes.
Done it twice so far, worked both times. I would never hit my bike with a hammer. I love my bike!!!