R3DB4R0N-StickyGun icon

StickyGun

Enemies can no longer knock your gun out of your grab. Guns only - everything else drops exactly as in vanilla. Client-side, install it or don't.

Last updated 2 hours ago
Total downloads 33
Total rating 0 
Categories Mods Weapons Client-side AI Generated Quality Of Life
Dependency string R3DB4R0N-StickyGun-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2305 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2305

README

StickyGun

Keep your gun in your hands when it matters.

A small, client-side R.E.P.O. mod that stops enemies knocking your gun out of your grab mid-fight. Guns only. Nothing else in the game changes.

StickyGun keeping a gun in hand under fire


The problem

The deeper you go in R.E.P.O., the harder enemies hit. Past a certain force, a hit doesn't just hurt you — it knocks whatever you're holding straight out of your grab. On moon-phase levels, where enemy attacks are scaled up hard, this happens constantly.

So you round a corner into a Headman and a Reaper, raise your shotgun, take one hit, and your gun is bouncing across the floor. You're now unarmed, in a fight you were equipped for, scrambling after a gun that may well have gone down a pit.

It isn't difficulty. It's a coin flip that ignores everything you brought to the fight.

What StickyGun does

While you're holding a gun, enemy hits can't knock it out of your grab.

That's it. Get slapped, tackled, blown across the room or pinned by three enemies at once — the gun stays where you put it. You still take the damage, you still get knocked around, you just don't get disarmed.

You drop the gun when you decide to: let go, stow it in an inventory slot, or die.

What StickyGun does not do

This is not a combat buff. It does not touch:

  • damage, fire rate, reload speed, or ammo
  • accuracy, spread, or aim
  • gun range, projectiles, or anything about how shooting works
  • enemy health, damage, or behaviour
  • any item that isn't a gun

Valuables, orbs, drones, carts, grenades and health packs all still get knocked out of your hands exactly as they do in vanilla. Cart-mounted cannons are deliberately excluded — the game labels them "guns" internally, but you can't hold and fire one, so they behave as normal.

Drones still knocked out of the player's hands

When you'll actually notice it

On early levels, enemy hits usually aren't strong enough to disarm you in the first place, so StickyGun quietly does nothing. It earns its keep on moon-phase levels, where attacks are scaled up and losing your gun is otherwise routine.

Development testing was done on level 18, full moon, where enemies hit at double the force needed to disarm you.

Multiplayer

Client-side. Install it or don't — either works.

StickyGun only changes what happens on your own machine, to your own gun. If you have it, your gun stays in your hands. If someone in your lobby doesn't have it, they simply play vanilla. Host or client, modded lobby or not, nobody needs to match anyone else's setup.

Tested against

Verified on a full-moon level, one gun in hand, against:

Enemy Result
Reaper, while it's running onto you swinging blades Gun kept
Headman, when it focuses and hits Gun kept
Trudge, when it pulls you and hits Gun kept
Robe, when hits Gun kept
Bowtie, when it blows air Gun kept
Loom, when slaps Gun kept
Headgrabber, when hits Gun kept
Mentalist, when it lifts you Gun kept
Heart Hugger, when it pulls you and hits Gun kept
Peeper Unaffected — it grabs you in the eye, not your gun
Headman + Reaper + Robe together Gun kept
and others, all while in fight Gun kept
Upscream Not covered — see below

Trudge pulling the player in, gun stays in hand

Also confirmed: falling and fall damage, tumbling on purpose, being carried around by enemies, extraction, level changes, and the shop all behave normally.

Keeping the gun through a fall

Known limitation: Upscream

Upscream is the one enemy StickyGun can't help with. It disarms you through a completely different piece of the game's code — one that is indistinguishable from you letting go of the grab deliberately. Blocking it would break normal releasing, which is a far worse trade.

If Upscream takes your gun, that's expected behaviour, not a bug.

Guns from other mods

StickyGun identifies guns by the game's own gun component, which is the same thing R.E.P.O. itself uses. Any modded gun built on it should be protected automatically, with no configuration needed.

This hasn't been tested against a specific gun mod yet, simply because none were installed during development. If you use one and it works — or doesn't — please open an issue and say which mod.

Installation

Requires BepInEx 5.4.x (Mono). No other dependencies.

  1. Install BepInEx into your R.E.P.O. folder and run the game once so it sets itself up.
  2. Drop StickyGun.dll into:
    <R.E.P.O. folder>\BepInEx\plugins\
    
  3. Launch the game.

To confirm it loaded, check BepInEx\LogOutput.log for:

[Info   : StickyGun] [StickyGun] loaded
[Info   : StickyGun] [StickyGun] settings: Enabled=True ...

To uninstall, delete the DLL. Nothing is left behind that affects the game.

Configuration

Settings live in BepInEx\config\StickyGun.cfg, created the first time you run it.

Setting Default What it does
Enabled true Master switch. false restores vanilla behaviour completely.
IncludeModdedGuns true Detect guns by component, so guns added by other mods are covered too. Set false to protect only the game's own guns.
DiagnosticMode false Log a line each time a gun is saved. Useful for confirming the mod is working.
DebugLogging false Very verbose logging. Only needed when reporting a bug.

Edit the config with the game closed. BepInEx rewrites the file when the game exits, so changes made while playing are discarded.

How it works

For the curious — the whole mod is about one line of R.E.P.O.'s code.

When something hits an object you're holding, the game runs a check along these lines:

if (hitForce >= 5f
    && physGrabObject.playerGrabbing.Count > 0
    && !physGrabObject.overrideKnockOutOfGrabDisable)
{
    // force everyone holding it to let go
}

That last condition is R.E.P.O.'s own off-switch for the mechanic — and melee weapons already use it, asking for the protection every frame while you hold one. That is the entire reason a melee weapon survives a hit and a gun doesn't.

StickyGun asks for exactly the same protection, for guns, through the same function the game provides. It doesn't block anything, override any behaviour, or fight the engine — it just puts guns on the same footing melee has always had. The flag runs on a short timer that expires by itself, so switching the mod off returns you to vanilla within a fraction of a second.

Building from source

Requires the .NET SDK.

dotnet build -c Release

Output: bin\Release\netstandard2.1\StickyGun.dll

Game assemblies come from NuGet (R.E.P.O.GameLibs.Steam), so no local game install is needed to compile.

Reporting a problem

Set DebugLogging = true in the config (with the game closed), reproduce the issue, then open an issue including the [StickyGun] lines from BepInEx\LogOutput.log.

🔗 github.com/R3DB4R0N/StickyGun