change speed parameter to rate, since camera panning occurs by adding values, not setting a speed.