How could I make a golf robot from a LEGO NXT kit? I want to make a golf robot. It will be placed straight in line with the ball. It will approach the ball and swing.

The part where I get confused is how to get it to swing in a left-right motion when the motor attached is heading towards the ball.

I want to know how to build it!! I tried following some images I found online but there weren’t any details about the design.

This is what I would like to build. I'm curious about the motor and the golf swing part!
This model uses gears to do 2 things:  


Change the direction of motion:  


The motor turns an axle, on which a gear is attached (partially hidden black disk in the picture).
The first two gears shift the rotation out in front of the motor.  
The next two knob wheel "gears" turn the rotation 90 degrees, resulting in the golf club motion you see in the picture.

Increase the speed of the golf club:
When you combine gears of different sizes you can change how fast or how strong the output is.
The first two gears have 36 teeth and 12 teeth, in that order. This makes the golf club move 3 times faster than the motor.
If you were to swap the gears, putting the small 12 before the 36, it would make the club 3 times slower than the motor.  


You can find building instructions here. This model was designed to be built with the NXT Education Base Set. If you have the normal NXT retail set, you won't be able to follow the instructions exactly; there will be a few missing pieces, but it should still be pretty easy to find suitable replacement parts from what you have in the kit.