Learning how to control impact