The new Star Wars movie isn’t even out yet, and we already have a character that we totally love: the spinning BB-8 drone that’s even cuter than R2-D2. Yes, I said it. Unsurprisingly, the tiny robot that went viral after appearing in the first official trailer has inspired a series of smart, remote-controlled toys that everyone’s talking about.

But how does it really work?

DON’T MISS: I think I’ve figured out how much the new Nexus 5 will cost

Sphero now has a $149.99 gadget that you can already buy in stores, and it’s controlled using your smartphone and your voice.

What makes the spherical robot very interesting is the head sitting on top of the sphere that remains somewhat stationary even when the device is moving. It appears as though it’s magically levitating.

HowBB8works.com is a site specifically designed to explain how the awesome new robot works, created by two Spanish Star Wars fans who did an excellent job looking at the new device.

The site even dug up an old Disney patent that was filled in 2010, two years before Disney purchased LucasFilm and four years before they invested in Sphero, the company that built the cute robot toy shown in the video below.

The patent seems to shed some light on how a spherical robot would work. Titled “Magnetic spherical balancing robot drive,” the patent describes holonomic motion for robots – that means they can move in any direction on the horizontal plane, making them incredibly responsive.

There are several variants of holonomic robot explained in a patent, including one that contains a wheel-based drive system inside a sphere that is able to stay in the same relative position with respect to the sphere. Add to that other internal components, including a remote-controlled drive system, gyroscopes, accelerometers and a base plate to act as a counterweight, and you’ve got almost everything you need to keep BB-8’s head on top of the sphere at all times, regardless of movement.

Almost everything, because you also need magnets both at the top of the mast inside the sphere and at the base of the head. Magnetic induction is what keeps the BB-8’s head on top of the rolling sphere base. It’s not magic, and it’s not CGI. Instead, it’s simply physics at work.