Another way would be to do shadow swings and stop where you want to make contact. Hold for just a second and then continue the swing. First do this without moving your feet much for a lot of repetitions. Once you are comfortable with that do the same but now move sideways as if you are running to the ball before shadowswinging. Again do lots of repetitions over and over. Then try it with the ball, again first with very easy shots and then moving.