If you have never seen a coil gun before. It is pretty cool tech. Put simply, it is an energy weapon that shoots a kinetic projectile. There is confusion about the difference between a coil gun, a guass gun, and a railgun. So before we get to the Coil gun. We should explain the difference. The Wikipedia entry on the Coil gun explains it as.
Coil gun
Coil guns are distinct from railguns, as the direction of acceleration in a railgun is at right angles to the central axis of the current loop formed by the conducting rails. In addition, railguns usually require the use of sliding contacts to pass a large current through the projectile or sabot, but coil guns do not necessarily require sliding contacts.[2] While some simple coilgun concepts can use ferromagnetic projectiles or even permanent magnet projectiles, most designs for high velocities actually incorporate a coupled coil as part of the projectile.
Coilguns are also distinct from Gauss guns, although many works of science fiction have erroneously confused the two. A coil gun uses electromagnetic acceleration whereas Gauss guns predate the idea of coil guns and instead consists of ferromagnets using a configuration similar to a Newton's Cradle to impart acceleration.
https://en.wikipedia.org/wiki/Coilgun
A coil gun, as each coil is turned on. It creates a magnetic attraction to accelerate the projectile.
https://en.wikipedia.org/wiki/Coilgun
Here is an example of how a Guass gun would fire a projectile.
25 Jun 2015 - How does a Gauss rifle work? - Magnet Expert
A railgun is a linear motor device.
Linear motor
A linear motor is an electric motor that has had its stator and rotor "unrolled", thus, instead of producing a torque (rotation), it produces a linear force along its length. However, linear motors are not necessarily straight. Characteristically, a linear motor's active section has ends, whereas more conventional motors are arranged as a continuous loop.
https://en.wikipedia.org/wiki/Linear_motor
The video contains diagrams of the linear motor concept.
6 Mar 2012 - US Navy railgun: how it works - News Direct
There are a lot of do-it-yourself Coil gun YouTube videos. From handheld guns to rifles.
11 Nov 2016 - Coil Gun with 3 levels electromagnetic accelerator - EVJ-World
In this video, you can see the barrel spins on this gun (4:12 seconds on the video). Which causes the projectile to spin as it is fired. A spinning projectile is a more accurate and stable projectile. A very nice addition.
23 Aug 2021 - My 1.5KJ Home-Built Gauss Rifle! - Benjamin Marshall