There was an abundance of boss costumes this halloween (case in point: cat Daryl from The Walking Dead) but one of our favourites was definitely this real-life Aladdin's magic carpet, which appeared to fly around New York City floating just off the ground, and promptly freaked a lot of people out in the process. It's not just the originality of the costume though, it's the engineering genius that went into creating it. Because building a stable carpet platform on top of a remote-controlled electric skateboard is no easy feat.

The costume was created by the team over at the PrankvsPrank YouTube channel, who specialise in, you guessed it, pulling pranks on unsuspecting victims. The idea was pretty simple – to create an Aladdin costume that didn't just look cool, but could actually float around the city. And that's where the science comes in.

To start with, they used an electric skateboard called the Boosted Board as their base. The skateboard is powered by a lithium-ion battery, and is charged up mid-ride by regenerative braking. Impressively, it can reach a top speed of 32 km/h (20 mph) but for the purpose of a smooth magic carpet ride, the PrankvsPrank team took things a bit slower than that.

Although the electric board can be steered like a normal skateboard, by shifting your weight from side to side, it also works with a Bluetooth remote, which allows you to be pretty passive while riding and, in this case, actually sit down on the job.

Next, the team had to create the magic carpet itself, which involved crafting a frame out of plastic piping and figuring out how to somehow attach it to the board, before covering the whole thing in a red, carpet-like material, complete with tassels.

You can watch the full process – and the illegal drone work involved in filming the prank – in the behind-the-scenes video below. And before you say anything, we know it's disappointing that the carpet doesn't actually fly, but we think getting something to look like it's hovering above the ground all over New York City is still pretty impressive.

An honourable Halloween mention also goes to this guy in Chicago, who created his own magic carpet using a mini-segway, which went viral all over Instagram and Vine. His carpet isn't quite as levitated as the PrankvsPrank team (there's some definite dragging going on), but thanks to him we now have a new life goal – riding a magic carpet through drive-through. Thank you, Halloween pioneers everywhere.