Garry's Mod - Gauss Rifle?

Hello, fellow facepunchers

Now, i have heard a thing or two about Gauss rifles (or railguns/coilguns) and i think to myself: Gmod has decent physics, explosives and magnetize tools, so is it possible to create a gauss rifle (or something similar) in gmod?

I haven’t played Garry’s Mod for ages, but the basic idea would be to make a basic cannon, with a basic projectile (much like the potato cannon from PHX3), and place magnetized props along the barrel to increase the projectiles speed.

I’m going to have a go at this myself, but please, if any of you have tried it/are going to, feel free to post ideas/results here

Isn’t this basically how the hl1/hl2beta tau cannon works? :crossarms:
Or,at least,how it should have worked.

nope cause source physics fails, and as far as i know the magnet stuff only works if the two props touch each other ie no magnetic feilds

Pretty sure it doesn’t work, I gave it a try long ago.

It failed at me so im pretty sure it dosen’t work.

Oh well, was worth a shot. Thanks for the feedback, didn’t work for me either

Why mess around with magnetism when you can just set the projectile’s velocity?

Why even build anything when theres probably already a dupe of something similar available? Because it’s fun

You could angle forcers along a barrel so they push a projectile like a railgun.

Youre confusing gauss and railguns. Railguns propel a solid object by running current through a magnet ligned barrel. they exist irl. Gauss guns are about acctually firing the energy itself (like the jeep gauss cannon) and are restricted to science fiction. A gauss gun wouldn’t be possible mechanically, though it could always be written in lua. Railguns can work mechanically using applyForce, but probably most realistically from a forcer ligned barrel. The magnet tool will not work, as there is no attraction, it’s only a contact- weld with a force limit.

Not true, a gauss gun is the same as a coil gun- using the magnetic fields made when a current is discharged into a series of coils;

While a rail gun uses two charged rails accelerate the projectile (which is in contact with the rails)

doesnt the US Navy’s railgun prototype fire a normal propellant-loaded shell and then the shell is accelerated in railgunny ways?

If I’m correct, the shell isn’t loaded with anything, and it has no warhead. It just goes so fast it creates a load of plasma behind it.

Yeah, it’s just a metal bar.

Couldn’t you line the barrel with field generators from Wire Extras? Have it track the position of the projectile and turn on a repulsing force after the projectile gets ‘x’ far along the barrel, else turn on an attractive force.

This is possible but I am not sure the field generators are fast acting enough to work, I seem to remember them being slow.
That said, I have a terrible memory and I have played on some shit servers.

Another possible issue is the field generators effecting the gun itself.

I would try this but my E2 knowledge is lacking. :sigh:

Field generators have a tickbox for ‘ignore constrained props’ or something like that.

Cool beans, some one try this now.