For moving sideways, the LEGO construction is guided by a plastic rail. The rail has holes to mark the positions in the storage rack. At the end, there a few extra holes to signal to the software that the end is reached. Otherwise the truck may fall of its base if it goes too far, especially at start-up when it does not yet know its position.
Blue arrows show the position of the infrared LED and receiver, for detecting the holes for the horizontal position. You can also see the motor and some gears for the horizontal position. (For this image, the device is positioned off-track).
This picture shows the lift motor, one of the broken rubber belts, and the other belt (that is broken outside this view).
How are the motors controlled ? This is from the era before the cheap Chinese boards. And it shows that the perfboard that you have on hand, is always too small for your project...
But we are lucky that the board has two sides:
Do you like meccano as heatsink for the 7805 ?