An anti-gravity gun makes things float. Sometimes it's a powerful weapon that could possibly threaten the integrity of the planet upon which it's used. Sometimes it's wielded by any random idiot.
Find Your Fate Junior
Originally developed on Cybertron, the anti-gravity gun proved too unstable to continue using. However, Megatron secretly rebuilt the weapon on Earth, where the continued integrity of the planet is much less of a concern.
The anti-gravity gun is subject to severe and uncontrollable fluctuations in the degree to which it nullifies the effect of gravity. At its highest settings, it can cause objects to fly off into space. The version built on Earth is much more powerful. The unstable energies of the anti-gravity gun could potentially cause a localized rip in the space-time continuum if mishandled.
On Cybertron, the Decepticons experimented with anti-gravity gun technology, using it on many Autobot emplacements. The Autobot Smokescreen's home was almost sent floating off into space in one of these attacks. The technology was eventually abandoned after 1) even the Decepticons found its unstable nature too dangerous, and 2) Optimus Prime turned the weapon on them, using its reverse setting to send them plummeting down into Cybertron's lower levels. (The embarrassment of the latter probably had more to do with the technology's abandonment than the former did.)
Millions of years later on Earth, Megatron had a secret base constructed to develop the technology again, building a much more powerful weapon. He ordered Dirge to attract attention deliberately so that he could bring the weapon to bear on the Autobots as they approached the base.
Megatron's ultimatum was simple: Optimus Prime would deactivate himself and give himself to the Decepticons, or Megatron would send every human on the face of the Earth hurtling off into space.
Desert Flight was a Multipath adventure; as such, there were many outcomes to this basic conflict. In some of them, Megatron triumphed, even making good in one such victory on his threat to destroy all human life. In many others, the weapon was destroyed, and in one, Megatron himself was destroyed by the weapon, his parts repelling themselves into pieces.