What you're seeing in the above gif is the innards of the BB-8 model that flatly disproved fan theories that the beloved droid could only exist as a CGI creation. On a panel with the animatronics experts behind The Force Awakens, we learned that there is in fact a small army of BB-8s, all purpose-built for different applications, and the remarkable engineering in the gif above was strictly for Hollywood's red carpet. Most images: Star Wars.
The designers have been tight-lipped about how it functioned. The solution to keeping the head upright was a bevy of magnets attached to a pendulum, while puppeteering was made easier by some clever programming that made "forward" on the controls mapped to whichever direction BB-8's head was facing.
Image: Loose Lips
While the red carpet variation might be the closest to a real BB-8, in total there were seven different models made for the filming of TFA. Each one was operated slightly differently but all were modular, as the extreme heat on Jakku (see: The Rub' al Khali desert) and constant rolling around led to panels and parts regularly wearing out. The engineering team, led by Matt Denton and Josh Lee, were given only two months of research and development, and a little over three months of production time.
An early BB-8 proof of concept
Among the multitude of BB-8s were both puppets and full fledged robots, most of which required two operators -- one for the head and one for the body. One of the most impressive was nicknamed the Trike, after its three-wheeled design. It required extensive modelling in a simulator before it could be fabricated due to the unusual physics of having several wheels moving at different speeds.
Each BB unit was visibly a puppet from some angle (one presumes those portions of the models were shot around or painted out in post production) except the red carpet version.
Now that the engineering for a truly functional BB droid has been figured out it's unknown if the red carpet version will show up in Episode VIII. Even if it's just for show, it's an impressive feat Lee and Denton were able to pull off in a remarkably short time.