Well one type of UAV is quadcopter , quadcopter has 4 motors actuators , where these four separately controlled by the main controller , usually with atmega microcontroller or are now widely using ready-made modules like ardupilot and multiwii . Well the quadcopter is moving with the motor , where the two motors have different rotational direction with two other motors . the question is how quadcopter flying vertically , laterally and remain in place ? The following animation might explain your question
The next one (bellow) shows how the quadrotor would increase altitude.
Here's how the quadrotor would move along the horizon plane
Finally, this animation shows how the quadrotor would rotate around it's main vertical axes (yaw)