need help with a animation or physics

4740590--449807--hammer forum.png

I want to get the to and fro moment of this hammer from a fixed point of top of hammer.PLEASE HELP ME WITH THIS.
THANKS IN ADVANCE.

add a kinematic rigidbody to the scene (at the hammer’s handle)
add a hingejoint to the the hammer and add the previously created kinematic rigidbody as the connected body of hinge joint