Skip to content

Gun Asset Reference

The gun asset is the data definition for every ranged weapon in Unturned™ - automatic rifles, semi-automatic pistols, bolt-action snipers, pump-action shotguns, break-action single-shots, miniguns, rocket launchers, crossbows, and all other projectile-firing equipment. A gun asset determines fire rate, damage per target category, recoil pattern, spread behavior, reload timing, attachment compatibility, caliber linkage, projectile system (ballistic or physics), animation set, audio cues, jamming behavior, and the complete set of firing modes the weapon supports. It is the asset type with the largest configuration surface in the entire Unturned™ item system.

This article is the 57 Studios™ complete field reference for the ItemGunAsset class. It documents every property across all fourteen category tables, every enumeration value, both projectile systems, the caliber-linkage and attachment-hook systems, the reload and rechambering mechanics, the NPC reward integration surface, and the complete blueprint and crafting system that the gun asset inherits from ItemWeaponAsset. Worked .dat examples from shipped vanilla and mod guns provide real-world field validation. This article targets mod authors who have already completed at least one working gun mod and need a comprehensive reference for the full exploitation of the gun asset surface.

A custom assault rifle displayed in the Unturned inventory view

Documentation source: This article references the official Smartly Dressed Games modding documentation for class hierarchy and field definitions. Shipped game files from Bundles/Items/Guns/ in the Unturned™ installation directory provide field-level validation. All field names, types, defaults, and enum values are verified against both sources.

Who this article is for

This article is written for Unturned™ mod authors who have already built at least one gun mod following the Gun Mod Tutorial and who are familiar with the Unity prefab pipeline, the .dat authoring workflow, and the master bundle export process. If you are building your first gun mod, start with the tutorial and return to this article when you need to tune a specific system (recoil, jamming, spread, projectile ballistics). Readers who have not completed the prerequisite orientation articles on item asset anatomy and the master bundle workflow should finish those before attempting to use this reference.

What you'll learn

  • The complete Unity prefab structure for a gun asset, including child GameObjects for every attachment type, bow-specific setup, and economy item support
  • All fourteen property tables covering aim, calibers, damage, effects, firing mechanism, hook attachments, jamming, magazines, ballistics, physics projectiles, rechambering, recoil, shake, and spread
  • The four enumerations: EAction, EDriverTurretViewmodelMode, ERechamberGunAfterReloadMode, and the firing-mode flags
  • The ballistic projectile system: Ballistic_Travel, Ballistic_Steps, Bullet_Gravity_Multiplier, deterministic simulation, and hitscan fallback
  • The physics projectile system: Ballistic_Force, Projectile_Lifespan, Projectile_Penetrate_Buildables, and physics-simulated area-of-effect explosions
  • Caliber linkage: Caliber, Magazine_Caliber_#, Magazine_Calibers, Attachment_Caliber_#, Attachment_Calibers, and the Requires_NonZero_Attachment_Caliber flag
  • Attachment hook system: Hook_Sight, Hook_Grip, Hook_Tactical, Hook_Barrel, and the legacy ID attachment default fields
  • Reload, rechambering, and hammer mechanics
  • Jamming configuration: Can_Ever_Jam, Jam_Quality_Threshold, Jam_Max_Chance, Unjam_Chamber_Anim
  • NPC reward integration via the Shoot_Quest_ prefix
  • Complete worked .dat examples from shipped weapons

How the gun asset system works

The gun asset is part of the ItemGunAsset class, which inherits from ItemWeaponAsset, which inherits from ItemAsset. The inheritance chain determines which fields are available at each level. The ItemAsset base class provides identity fields (ID, GUID, Type, Name, Rarity, Slot, Size_X, Size_Y). The ItemWeaponAsset parent class provides weapon-specific fields such as Range, Player_Damage, Zombie_Damage, Durability, and Wear. The ItemGunAsset subclass adds every field documented in this article.

The fields that appear in a .dat file are read by the Unturned™ parser at load time. The parser maps each key-value pair to the corresponding property on the ItemGunAsset object. Unknown keys are silently ignored; missing keys use their engine defaults. The gun asset must carry Type Gun and Useable Gun to be recognized as a ranged weapon. Without either, the engine does not instantiate the ItemGunAsset class and the weapon does not function.

The engine also requires that the Action property is configured. The Action value determines which projectile system the weapon uses (ballistic or physics), which reload animation plays, and which subset of properties the engine reads. A gun without an Action field will fail to instantiate at load time.

Unity prefab structure

The Unity prefab for a gun asset requires a specific hierarchy of child GameObjects. The root GameObject carries the ItemGunAsset script reference (or more commonly, the prefab is referenced by the .dat file through the Name field, and the engine instantiates the prefab by name from the master bundle).

Required child GameObjects

The root prefab must contain six child GameObjects for a fully functional gun:

MyGunPrefab (root)
├── Barrel
├── Grip
├── Sight
├── Tactical
├── Magazine
└── Eject

The Barrel, Grip, Sight, Tactical, and Magazine child GameObjects determine the position of attachments on the gun. Each child's transform (position, rotation, scale) in the prefab defines where the attachment model appears when equipped. The Sight GameObject also determines where the camera is positioned when the player aims down sights. The Eject GameObject is the emission point for shell casings when the gun is fired. If an Eject GameObject is not present, shell casing particles emit from the root position.

An optional View GameObject provides the camera position for aiming down sights when no sight attachment is equipped. If View is present, its transform overrides the Sight child position for the hip-to-aim camera transition when no sight is attached. If View is absent, the engine falls back to the Sight child position for the unsighted camera position as well.

Caliber-specific attachment positions

When a gun accepts more than one caliber of magazine, the magazine attachment position should be adjusted per caliber to correctly seat different magazine shapes. Add a child to the Magazine GameObject named Caliber_# where # is the caliber ID:

Magazine
├── Caliber_1
├── Caliber_9
└── Caliber_14

This pattern is also supported for the other attachment type GameObjects (Barrel, Grip, Sight, Tactical). When the engine reads a caliber-matching child, it uses that child's transform instead of the parent's for attachment positioning.

Bow-specific setup

Bows and crossbows require additional GameObjects to simulate the drawing of the bowstring. The bowstring simulation is first-person only; third-person bow models do not display the string draw.

MyBowPrefab (root)
├── Rope (inactive by default; Line Renderer component)
├── Left (bowstring endpoint)
├── Right (bowstring endpoint)
├── Rest (bowstring midpoint when aiming down sights)
└── Nock (allows firing without aiming down sights)

The Rope GameObject should be inactive by default in the prefab and must include a Line Renderer component. Vanilla bowstrings use a custom Material named Rope with the Unlit-Rope Shader, but any Line Renderer material is acceptable. The Left and Right GameObjects define the endpoints of the bowstring. If a Rest GameObject is included, its position is used as the middle point of the bowstring when aiming down sights. If a Nock GameObject is included, the bow can be fired without aiming down sights - the Rest GameObject acts as the midpoint when not aiming, and the Nock GameObject acts as the midpoint when aiming. Without Nock, the String action mechanism requires the player to be aiming down sights before the weapon can fire.

Economy item setup (skins)

The economy item system supports several optional child GameObjects for skin rendering:

MyGunPrefab (root)
├── Icon2 (position and orientation for skin icon generation)
├── Stat_Tracker (position for stat tracker displays)
└── Effect (position for mythical effect particle systems)

Custom items (non-economy Workshop items) are ineligible to receive skins, so these GameObjects are not needed for standard Workshop mods. They are relevant only for items participating in the Steam economy item system, which is an advanced distribution path that requires additional configuration beyond the scope of a standard .dat file.

Animation prefabs

In addition to the animation states used by any equippable item (Idle, Equip, Unequip, Inspect), guns have a dedicated set of animation states:

Animation stateTriggerPurpose
Aim_StartPlayer presses aim buttonTransition from hip to sighted position
Aim_StopPlayer releases aim buttonTransition from sighted to hip position
Attach_StartAttachment equippedPlays when an attachment is attached to the gun
Attach_StopAttachment removedPlays when an attachment is detached from the gun
Sprint_StartPlayer starts sprintingTransition from idle to sprinting pose
Sprint_StopPlayer stops sprintingTransition from sprinting to idle pose
ReloadPlayer presses reloadFull reload animation cycle
HammerPost-reload or post-shot cycleManual bolt/pump/break-action cycle or after reloading an empty magazine
UnjamChamberJam occurs (jamming-enabled guns)Animation that clears a jammed chamber
InspectPlayer presses inspectIdle inspection animation

The Hammer animation plays under specific conditions defined by the RechamberAfterMagazineAttached, RechamberAfterMagazineDetached, and RechamberAfterShotCount fields. The animation state name in the Animator Controller must exactly match the state name used in the animation clip asset. A mismatch produces no animation playback for that event but does not produce an engine error.

Audio clips

Gun prefabs support a dedicated set of Audio Clip references beyond the equippable-item standard:

Audio clip nameWhen it plays
ShootAfter the gun is fired (primary audio)
ReloadAfter the reload animation begins
HammerWhen the hammer animation plays after a post-shot or post-reload cycle
AimWhen the player aims down sights (bow draw, sight flip-up)
MinigunWhile the minigun is revving (Action Minigun only)
ChamberJammedWhen a jam occurs (jamming-enabled guns only)

The Aim Audio Clip is particularly relevant for bows and crossbows, where the draw sound creates the player feedback for the string tension mechanic. The Minigun clip is exclusive to weapons using Action Minigun. The ChamberJammed clip requires Can_Ever_Jam to be set.

Complete property reference

The gun asset properties are organized into fourteen category tables in the official SDG documentation. The sections below reproduce every property from every table, with type, default value, and a prose description of its purpose.

Table 1: Uncategorized

The uncategorized table collects properties that do not fit neatly into any other category but that affect the weapon's behavior at a global level.

FieldTypeDefaultPurpose
Aim_In_Durationfloat320.2Time in seconds to fully transition from hip to aimed-down-sights position. Lower values produce a faster aim.
Aiming_Movement_Speed_Multiplierfloat32See descriptionMultiplier on the player's movement speed while aiming. Defaults to 0.75 when Can_Aim_During_Sprint is false. Defaults to 1.0 when Can_Aim_During_Sprint is true.
Alert_Radiusfloat3248Radius in meters within which zombies and animals are alerted when the gun is fired. Higher values produce a larger alert zone.
Can_Aim_During_SprintboolfalseWhen true, the player can sprint while aiming down sights.
Gunshot_Rolloff_Distancefloat32See descriptionDistance in meters over which the gunshot audio fades to inaudible. Defaults to 16 for Action String, 64 for Action Rocket, and 512 for all other action types.
Must_Aim_To_ShootboolSee descriptionWhen true, the gun cannot fire unless the player is aiming. Defaults to true for Action Minigun. Action String overrides this behavior regardless of the field value.
Range_Rangefinderfloat32See descriptionOverrides the maximum distance displayed when a rangefinder tactical attachment is equipped on this weapon. Defaults to the value of the Range property.
Scale_Aim_Animation_SpeedbooltrueWhen true, the Aim_Start and Aim_Stop animation lengths are scaled to match Aim_In_Duration plus modifiers.
Stop_Aiming_After_ShootingboolfalseWhen true, the gun stops aiming regardless of player input after firing.
DriverTurretViewmodelModeEDriverTurretViewmodelModeOffscreenWhileAimingControls first-person arm visibility for turrets operated from a vehicle driver seat.

The Aim_In_Duration field interacts with Scale_Aim_Animation_Speed. When scaling is enabled (the default), the animation speed is adjusted so that the transition completes in exactly the Aim_In_Duration time regardless of the animation clip's authored length. When scaling is disabled, the animation plays at its authored speed and the engine does not enforce the Aim_In_Duration timing.

Table 2: Calibers

The caliber table controls which magazines and hook attachments are accepted by the gun. This is the string-to-bow connection between the gun asset and the magazine and attachment assets.

FieldTypeDefaultPurpose
Caliberuint160Legacy caliber ID for both magazine and hook attachment compatibility. When Magazine_Calibers is not configured, this value applies to magazines. When Attachment_Calibers is not configured, this value applies to hook attachments. Caliber 0 is universal and accepts any magazine or attachment with caliber ID 0.
Magazine_Calibersint321Array length for Magazine_Caliber_#. Must equal the number of Magazine_Caliber_# instances in the .dat. When set to a value greater than 0, the Magazine_Caliber_# array is active and each entry defines an accepted magazine caliber.
Magazine_Caliber_#uint16See descriptionOne entry in the magazine caliber array. Each entry specifies a caliber ID that this gun accepts for magazine attachments. When unconfigured, defaults to 0. When Magazine_Calibers is not greater than 0, defaults to the value of Caliber.
Attachment_Calibersint32See descriptionArray length for Attachment_Caliber_#. When set to a value greater than 0, the Attachment_Caliber_# array is active. When not greater than 0, defaults to the value of Magazine_Calibers, and the Attachment_Caliber_# entries cannot be customized independently.
Attachment_Caliber_#uint16See descriptionOne entry in the attachment caliber array. Each entry specifies a caliber ID that this gun accepts for hook attachments. When unconfigured, defaults to 0. When Attachment_Calibers is not greater than 0, defaults to the corresponding Magazine_Caliber_# value.
Requires_NonZero_Attachment_CaliberboolfalseWhen true, hook attachments must specify at least one non-zero caliber ID to be compatible with this gun. Used to exclude vanilla attachments (caliber 0) from custom weapons.

The caliber resolution diagram shows the priority chain. The Magazine_Calibers and Attachment_Calibers arrays give the most precise control. When they are not used, the single Caliber field serves as a fallback for both magazine and attachment compatibility.

Table 3: Damage

The damage table controls body-part-specific multipliers that modify the base damage values inherited from ItemWeaponAsset.

FieldTypeDefaultPurpose
Damage_Falloff_Max_Rangefloat321Percentage of maximum range beyond which damage stops decreasing. A value of 0.6 with Range 200 means damage stops falling off after 120 meters.
Damage_Falloff_Multiplierfloat321Percentage of damage applied at maximum range. A value of 0.25 with a base damage of 40 means 10 damage is dealt at maximum range.
Damage_Falloff_Rangefloat321Percentage of maximum range at which damage begins decreasing. A value of 0.3 with Range 200 means damage begins falling off after 60 meters.
Instakill_HeadshotsboolfalseWhen true, a headshot against a player (not zombies unless the world difficulty has Weapons_Use_Player_Damage enabled) instantly kills the target regardless of remaining HP.

The Damage_Falloff_Max_Range and Damage_Falloff_Range fields define a damage plateau zone. The weapon deals full damage from zero range to Damage_Falloff_Range. Beyond that point, damage linearly decreases until Damage_Falloff_Max_Range, after which damage stays constant at Damage_Falloff_Multiplier of the base value. When both fields are 1, damage is uniform across the entire range envelope.

Table 4: Effects

The effects table controls visual and explosive effect references.

FieldTypeDefaultPurpose
ExplosionGUID or uint160GUID or legacy ID of the effect used for explosions caused by Action Rocket physics projectiles.
MuzzleGUID or uint160GUID or legacy ID of the muzzle flash effect emitted from the Barrel child GameObject after firing.
ShellGUID or uint16See descriptionGUID or legacy ID of the shell casing effect emitted from the Eject child GameObject after firing. Defaults to 33 for Action Pump and Action Break. Defaults to 1 for all other action types except Action Rail. Defaults to 0 for Action Rail.

The Muzzle and Shell effect references point to effect assets defined elsewhere in the content system. The vanilla effect IDs (3 for rifle muzzle flash, 4 for heavy weapon muzzle flash, 33 for shotgun shell ejection, 1 for standard shell ejection) are documented constants in the vanilla .dat files. Custom effects require registering a new effect asset and referencing its GUID.

Table 5: Firing Mechanism

The firing mechanism table defines how the weapon fires and which fire modes are available.

FieldTypeDefaultPurpose
ActionEAction(required)Determines the weapon's firing behavior, projectile system, and reload type. This is the single most important field on the gun asset.
Autoflagnot setWhen present, the weapon has an automatic firing mode (hold trigger for continuous fire).
Semiflagnot setWhen present, the weapon has a semi-automatic firing mode (one shot per trigger pull).
Safetyflagnot setWhen present, the weapon has a safety mode (cannot fire).
Burstsint320When greater than 0, the weapon has a burst-fire mode that fires this many shots per burst.
Firerateuint80Minimum number of ticks between consecutive shots. Higher values produce a slower rate of fire. The rate of fire in rounds per second is 50 ÷ (Firerate + 1).
Fire_Delay_Secondsint320Delay in seconds between the trigger pull and the shot being fired. Used for weapons with a delayed ignition such as a flintlock.

The combination of Auto, Semi, Safety, and Bursts defines the weapon's fire mode selector. A weapon with both Safety and Semi has two modes (safe and semi). A weapon with Safety, Semi, and Auto has three modes (safe, semi, auto). A weapon with Safety, Semi, Auto, and Bursts 3 has four modes (safe, semi, auto, burst). The engine cycles through present modes when the player presses the fire-mode key.

Table 6: Hook Attachments

The hook attachments table controls which attachment types the gun supports and which legacy ID attachments are equipped by default.

FieldTypeDefaultPurpose
Hook_Sightflagnot setWhen present, the gun has a sight attachment slot.
Hook_Gripflagnot setWhen present, the gun has a grip attachment slot.
Hook_Tacticalflagnot setWhen present, the gun has a tactical attachment slot.
Hook_Barrelflagnot setWhen present, the gun has a barrel attachment slot.
Sightuint160Legacy ID of a sight attachment to equip by default. Does not require Hook_Sight.
Gripuint160Legacy ID of a grip attachment to equip by default. Does not require Hook_Grip.
Tacticaluint160Legacy ID of a tactical attachment to equip by default. Does not require Hook_Tactical.
Barreluint160Legacy ID of a barrel attachment to equip by default. Does not require Hook_Barrel.

The Hook_* flags control whether the slot is present on the weapon. The Sight, Grip, Tactical, and Barrel legacy ID fields control which specific attachment is equipped by default. A weapon can have a default attachment without declaring the hook slot (the attachment model still attaches to the corresponding child GameObject). The hook slot flag is necessary for the player to be able to remove or replace the attachment in-game.

Table 7: Jamming

The jamming table controls the weapon jamming mechanic. Weapons that jam have a reliability curve based on their current quality value.

FieldTypeDefaultPurpose
Can_Ever_Jamflagnot setWhen present, the weapon can jam. Without this flag, all other jamming properties are ignored.
Jam_Quality_Thresholdfloat320.4The quality percentage below which the weapon can jam. A value of 0.4 means jamming can start occurring below 40% quality.
Jam_Max_Chancefloat320.1The maximum decimal-probability of a jam at the lowest quality. A value of 0.1 means a 10% maximum chance per shot. The chance blends from 0% at Jam_Quality_Threshold to Jam_Max_Chance at zero quality.
Unjam_Chamber_AnimstringUnjamChamberName of the animation clip to play when unjamming the weapon. Must match a state in the Animator Controller.

The jamming blend works linearly. At 100% quality, the jam chance is 0%. As quality decreases toward Jam_Quality_Threshold, the chance stays at 0%. Below Jam_Quality_Threshold, the chance linearly ramps up from 0% to Jam_Max_Chance as quality approaches zero. A weapon with Can_Ever_Jam, Jam_Quality_Threshold 0.8, and Jam_Max_Chance 0.5 has a 50% maximum jam chance at zero quality and starts jamming at 80% quality.

The vanilla Cobra_Jam example in the game files shows a weapon configured with Jam_Quality_Threshold 0.9 and Jam_Max_Chance 0.5 - a weapon that starts jamming early and has a high maximum jam rate. This configuration intentionally creates an unreliable weapon as a gameplay constraint.

Table 8: Magazine Attachments

The magazine attachments table controls reload behavior, magazine compatibility, ammunition counts, and magazine replacement logic.

FieldTypeDefaultPurpose
Allow_Magazine_ChangebooltrueWhen false, the magazine cannot be removed, replaced, or reloaded. Functions similarly to Hook_Barrel and Hook_Grip for magazine slots.
Ammo_Minuint80Minimum amount of ammunition randomly generated in the default magazine attachment when the weapon spawns.
Ammo_Maxuint80Maximum amount of ammunition randomly generated in the default magazine attachment when the weapon spawns.
Ammo_Per_Shotuint81Number of ammunition units consumed per shot. A value of 3 consumes three rounds per trigger pull. A value of 0 produces infinite ammunition.
Magazineuint160Legacy ID of the magazine attachment equipped by default.
Magazine_Replacementsint320Array length for Magazine_Replacement_#_ID and Magazine_Replacement_#_Map. When greater than 0, the weapon checks map-level conditions for alternative default magazines.
Magazine_Replacement_#_IDuint160Legacy ID of an alternative default magazine for a specific map. Used with Magazine_Replacement_#_Map.
Magazine_Replacement_#_Mapstring(empty)Name of the map on which Magazine_Replacement_#_ID should be used as the default magazine.
Delete_Empty_MagazinesflagdeprecatedDeprecated in version 3.30.3.0. Use Should_Delete_Empty_Magazines instead.
Hammer_Timefloat321Multiplier on the hammer pull cooldown after firing. Values below 1 have no effect. The hammer cooldown is the delay before the player can perform other actions after a shot.
Infinite_AmmoboolfalseWhen true, ammunition is not depleted from the magazine. The weapon needs a loaded magazine with at least Ammo_Per_Shot rounds to fire, but the rounds are not consumed.
Reload_Timefloat321Multiplier on the reload cooldown after starting a reload. Values below 1 have no effect.
Replacefloat321Multiplier on the reload animation length before the new magazine model appears. Values below 0.01 have no effect.
Unplacefloat320Multiplier on the reload animation length before the old magazine model is removed.
Should_Delete_Empty_MagazinesboolSee descriptionWhen true, empty magazine attachments are deleted from inventory when completely depleted. Defaults to true for Action Break, Pump, Rail, Rocket, and String. Defaults to false for all other action types.

The Replace and Unplace fields control the visual timing of magazine swapping during the reload animation. Unplace determines how far into the animation the old magazine disappears. Replace determines how far in the new magazine appears. A weapon that reloads slowly might use long Replace and Unplace values; a weapon with a snappy tactical reload might use short values.

Table 9: Projectiles (Ballistic System)

The ballistic projectile system uses a deterministic simulation for projectile travel. This is the system used by Action Trigger, Bolt, Pump, Rail, String, Break, and Minigun.

FieldTypeDefaultPurpose
Ballistic_Dropfloat32deprecatedDeprecated in version 3.23.7.0. Use Bullet_Gravity_Multiplier instead. Existing values are automatically converted if Bullet_Gravity_Multiplier has not been configured.
Ballistic_Stepsuint8See descriptionLifespan of the ballistic projectile in simulation steps. Higher values relative to Ballistic_Travel produce lower muzzle velocity. Must be greater than 0. Defaults to Range / Ballistic_Travel rounded up.
Ballistic_Travelfloat32See descriptionTravel speed of the ballistic projectile per simulation step. Higher values relative to Ballistic_Steps produce higher muzzle velocity. Must be greater than 0.1. Defaults to 10. When Ballistic_Steps is specified and Ballistic_Travel is not, defaults to Range / Ballistic_Steps.
Bullet_Gravity_Multiplierfloat324Multiplier on gravity acceleration for ballistic projectiles. A value of 1 produces realistic bullet drop at 9.81 m/s2. The default of 4 produces exaggerated drop suitable for Unturned's engagement distances.

The ballistic simulation uses a step-based model. The projectile advances Ballistic_Travel units per simulation step for Ballistic_Steps steps. The total distance the projectile can travel before despawning is Ballistic_Travel × Ballistic_Steps. When the ballistics game mechanic is disabled in the server configuration, ballistic projectiles function as hitscan (instantaneous hit detection at any range up to the weapon's Range value).

Common configuration pitfall: Configuring both Ballistic_Travel and Ballistic_Steps independently can produce a mismatch between the weapon's Range field and its actual projectile range. The documented recommendation is to configure either Ballistic_Travel or Ballistic_Steps but not both, and to leave the other field to its calculated default. Configuring neither produces default behavior where both fields are calculated from Range.

Table 10: Projectiles (Physics System)

The physics projectile system uses Unity's physics simulation for projectile behavior. This system is used exclusively by Action Rocket. Physics projectiles are not deterministic and cause area-of-effect explosions on impact.

FieldTypeDefaultPurpose
Ballistic_Forcefloat320.002Force in Newtons applied to the physics projectile. This is the thrust force applied via Unity's Rigidbody.AddForce. Higher values produce faster and more impactful projectiles.
Projectile_Explosion_Launch_Speedfloat32See descriptionSpeed at which players caught in the area-of-effect explosion are launched. Defaults to Player_Damage × 0.1. Used for rocket-jump-style gameplay mechanics.
Projectile_Lifespanfloat3230Lifespan of the physics projectile in seconds. After this time elapses, the projectile despawns without detonating.
Projectile_Penetrate_Buildablesflagnot setWhen present, area-of-effect explosions from physics projectiles penetrate through buildable structures.

Physics projectiles are physical Unity objects with Rigidbody components. Their trajectory is influenced by gravity, collisions, and applied force in a way that is not deterministic across different frame rates or physics simulation timesteps. This makes physics projectiles suitable for explosive munitions where deterministic accuracy is less important than area-of-effect gameplay.

The sequence shows the physics projectile lifecycle. Unlike ballistic projectiles, which are simulated in a deterministic step model, physics projectiles are full Unity physics objects that interact with the world through the physics engine.

Property systemProjectile simulationDeterministic?Area-of-effect?Used by
BallisticStep-based, engine-calculatedYes (same trajectory every time at same inputs)NoTrigger, Bolt, Pump, Rail, String, Break, Minigun
PhysicsUnity physics engineNo (varies by framerate, physics timestep)Yes, on impactRocket

Table 11: Rechambering Properties

The rechambering table controls the hammer animation timing and shell casing ejection behavior after firing and reloading.

FieldTypeDefaultPurpose
CasingEjectCountAfterRechamberingAfterShootingint321Number of shell casing particles ejected after the hammer animation following a shot. Only applicable when RechamberAfterShotCount is non-zero. Ejection occurs after EjectAfterHammerDelay seconds.
CasingEjectCountAfterReloadint32See descriptionNumber of shell casing particles ejected after a reload. Defaults to Ammo_Max for Action Break guns. Zero for all other action types. Ejection occurs after EjectAfterReloadDelay seconds.
EjectAfterHammerDelayfloat320.45Delay in seconds after the hammer animation before shell casing particles eject. Only applicable when RechamberAfterShotCount is non-zero.
EjectAfterReloadDelayfloat320.5Delay in seconds after the reload animation before shell casing particles eject. Only applicable when CasingEjectCountAfterReload is greater than zero.
EjectCasingAfterShootingboolSee descriptionWhen true, a shell casing particle ejects on each shot. Defaults to true for Action Trigger and Action Minigun.
RechamberAfterMagazineAttachedERechamberGunAfterReloadModeIfAmmoWasEmptyDetermines whether the hammer animation plays after a magazine is attached. This occurs when a magazine replaces another or fills a previously empty slot.
RechamberAfterMagazineDetachedERechamberGunAfterReloadModeAlwaysDetermines whether the hammer animation plays after a magazine is detached. This occurs when a magazine is removed without a replacement.
RechamberAfterShotCountint32See descriptionIf non-zero, the hammer animation plays after this many consecutive shots. The shot count resets after reloading, hammering, or dequipping the weapon. Defaults to 1 for Action Bolt and Action Pump. Zero for all other action types.
RechamberAfterShotDelayfloat320.25Delay in seconds after the last shot before the hammer animation plays. Only applicable when RechamberAfterShotCount is non-zero.

The CasingEjectCountAfterReload field is notably set to Ammo_Max for break-action weapons, which eject all spent shells at once when the weapon is broken open for reloading. Pump-action and bolt-action weapons typically eject one casing per manual cycle.

Table 12: Recoil

The recoil table controls camera recoil values and per-stance multipliers.

FieldTypeDefaultPurpose
Aiming_Recoil_Multiplierfloat321Multiplier on all recoil values while aiming down sights.
Recoil_Min_Xfloat320Minimum horizontal recoil in degrees (negative is leftward).
Recoil_Max_Xfloat320Maximum horizontal recoil in degrees.
Recoil_Min_Yfloat320Minimum vertical recoil in degrees (negative is upward).
Recoil_Max_Yfloat320Maximum vertical recoil in degrees.
Recover_Xfloat320Multiplier on horizontal camera recovery over the next 250 milliseconds after recoil settles.
Recover_Yfloat320Multiplier on vertical camera recovery over the next 250 milliseconds after recoil settles.
Recoil_Crouchfloat320.85Multiplier on camera recoil while crouched.
Recoil_Pronefloat320.7Multiplier on camera recoil while prone.
Recoil_Sprintfloat321.25Multiplier on camera recoil while sprinting. Only relevant when Can_Aim_During_Sprint is true.
Recoil_Swimmingfloat321.1Multiplier on camera recoil while swimming.
Recoil_Midairfloat321.0Multiplier on camera recoil while jumping or falling.

The recoil system selects a random value between Recoil_Min_X and Recoil_Max_X for horizontal deflection and between Recoil_Min_Y and Recoil_Max_Y for vertical deflection on each shot. The Recover_X and Recover_Y fields apply a counter-animation that brings the camera back toward the original position over 250 milliseconds. A weapon with Recover_Y 0.6 recovers 60% of the vertical deflection over the recovery window.

Table 13: Shake

The shake table controls model shake values, which produce a visual trembling effect on the weapon model independent of camera recoil.

FieldTypeDefaultPurpose
Shake_Min_Xfloat320Minimum horizontal model shake amplitude.
Shake_Max_Xfloat320Maximum horizontal model shake amplitude.
Shake_Min_Yfloat320Minimum vertical model shake amplitude.
Shake_Max_Yfloat320Maximum vertical model shake amplitude.
Shake_Min_Zfloat320Minimum depth-axis model shake amplitude.
Shake_Max_Zfloat320Maximum depth-axis model shake amplitude.

Model shake is a visual-only effect that simulates the mechanical vibration of the weapon after firing. The engine selects random values within the min-max range for each axis on every shot. Shake does not affect aim precision or recoil - it is purely cosmetic feedback.

Table 14: Spread

The spread table controls bullet angle-of-deviation values and per-stance multipliers.

FieldTypeDefaultPurpose
Spread_Aimfloat320Multiplier on Spread_Angle_Degrees while aiming down sights.
Spread_Angle_Degreesfloat320Base bullet angle of deviation in degrees from the aiming direction. A value of 15 means the shot can deviate up to 15 degrees from the crosshair center. All other spread values are multipliers applied to this base.
Spread_Crouchfloat320.85Multiplier on Spread_Angle_Degrees while crouched.
Spread_Pronefloat320.7Multiplier on Spread_Angle_Degrees while prone.
Spread_Sprintfloat321.25Multiplier on Spread_Angle_Degrees while sprinting.
Spread_Swimmingfloat321.1Multiplier on Spread_Angle_Degrees while swimming.
Spread_Midairfloat321.5Multiplier on Spread_Angle_Degrees while jumping or falling.
Spread_Hipfloat32deprecatedDeprecated in version 3.22.20.0. Use Spread_Angle_Degrees instead. Maintained for backward compatibility.

The spread calculation for any given shot is Spread_Angle_Degrees × stance_multiplier. A weapon with Spread_Angle_Degrees 10 and Spread_Aim 0.1 has an effective spread of 1 degree while aiming and 10 degrees while hip-firing (no multiplier applies in hip-fire). The Turret flag, when set, treats the weapon as a vehicular turret and affects the first-person viewmodel independently of the spread system.

Enumerations

The gun asset defines four enumerations that control critical behavior categories.

EAction

The Action field uses the EAction enumeration, which is the single most important field on the gun asset. The action type determines the projectile system, the reload mechanic, and the shell casing behavior.

Named valueProjectile systemReload typeShell casing defaultTurret behavior
TriggerBallisticFull magazine swapDefaults to true for EjectCasingAfterShootingStandard weapon
BoltBallisticSingle-round chamberRechamberAfterShotCount defaults to 1Standard weapon
PumpBallisticSingle-round chamberRechamberAfterShotCount defaults to 1; Should_Delete_Empty_Magazines defaults to trueStandard weapon
RailBallisticSingle-round chamberShell defaults to 0Standard weapon
StringBallisticSingle-round chamberBow-specific audio defaults (Gunshot_Rolloff_Distance defaults to 16)Standard weapon
BreakBallisticSingle-round chamberShould_Delete_Empty_Magazines defaults to true; CasingEjectCountAfterReload defaults to Ammo_MaxStandard weapon
RocketPhysicsSingle-round chamberUses physics projectile system; area-of-effect explosion on impactStandard weapon
MinigunBallisticFull magazine swapEjectCasingAfterShooting defaults to true; Must_Aim_To_Shoot defaults to trueStandard weapon

Each EAction value also determines the audio categories used for the weapon's firing sound. The Gunshot_Rolloff_Distance default is 512 for all actions except String (16) and Rocket (64).

EDriverTurretViewmodelMode

The DriverTurretViewmodelMode enumeration controls how first-person arms are displayed when the weapon is operated from a vehicle's driver seat.

Named valueDescription
OffscreenWhileAimingDefault. Pushes first-person arms off-screen while aiming in a turret. Originally implemented for the Fighter Jet where visible arms look incorrect when the camera zooms in.
AlwaysOffscreenPushes first-person arms off-screen whenever the weapon is equipped in a turret.
AlwaysOnscreenFirst-person arms remain visible regardless of turret aiming state. Included for completeness.

The AlwaysOnscreen value is the least common and exists primarily for debugging and for turret setups where the viewmodel intentionally obscures part of the screen.

ERechamberGunAfterReloadMode

The RechamberAfterMagazineAttached and RechamberAfterMagazineDetached fields use this enumeration.

Named valueDescription
IfAmmoWasEmptyDefault. The hammer animation plays only if the ammo count was zero before the magazine attachment or detachment.
NeverThe hammer animation never plays after magazine attachment or detachment, regardless of ammo count.
AlwaysThe hammer animation always plays after magazine attachment or detachment, regardless of ammo count.

The IfAmmoWasEmpty setting is the most common for conventional firearms: the hammer cycles only when a fresh magazine is loaded into an empty chamber. The Always setting is used for weapons where the action cycles on every reload, such as some pump-action and break-action designs that eject a chambered round on any reload.

Fire-mode flag combination

The Safety, Semi, Auto, and Bursts fields collectively define the weapon's available firing modes. They are processed as flags and a numeric count rather than as a single enumeration:

Mode presenceSafetySemiAutoBursts
Safe + SemiPresentPresentAbsent0
Safe + Semi + AutoPresentPresentPresent0
Safe + Semi + BurstPresentPresentAbsent3 (example)
Safe + AutoPresentAbsentPresent0
Semi + AutoAbsentPresentPresent0
Semi onlyAbsentPresentAbsent0
Auto onlyAbsentAbsentPresent0

The engine cycles through the configured modes in order. Each press of the fire-mode key advances to the next available mode. When the last mode is reached, the next press cycles back to the first.

NPC reward integration

Gun assets can define quest rewards that fire when the weapon is used. These rewards use the Shoot_Quest_ prefix and follow the standard Unturned quest reward system. For example, a configuration that spawns an item in the player's inventory every time the gun is fired uses the Shoot_Quest_Rewards field. Every shot fired from the weapon triggers the reward evaluation. This mechanic is exposed in the NPC rewards documentation.

The Shoot_Quest_Rewards array follows the same format as other quest reward arrays. Each entry in the array specifies one or more items to spawn, with optional probability and amount. The rewards fire on every shot unless the reward entry specifies conditions that suppress it.

Worked .dat examples

The examples below are taken from or derived from shipped vanilla .dat files in the Unturned installation. Each example demonstrates a different weapon category and field configuration pattern.

Example 1: Semi-automatic assault rifle (Eaglefire)

The Eaglefire is a semi-automatic and burst-fire assault rifle that accepts NATO 5.56mm (caliber 1) magazines.

GUID b03d581a5c1a490f995f8deba57b0f17
Type Gun
Rarity Rare
Useable Gun
Slot Primary
ID 4

Size_X 4
Size_Y 2
Size_Z 0.4
Size2_Z 0.6

Sight 5
Magazine 6

Hook_Sight
Hook_Tactical
Hook_Grip
Hook_Barrel

Ammo_Min 10
Ammo_Max 30

Safety
Semi
Bursts 3

Caliber 1

Range 200
Firerate 4
Action Trigger

Player_Damage 40
Zombie_Damage 99
Animal_Damage 40
Barricade_Damage 20
Structure_Damage 15
Vehicle_Damage 35
Resource_Damage 15
Object_Damage 25

Durability 0.15

Aim_In_Duration 0.25
Spread_Aim 0.05
Spread_Angle_Degrees 5.71

Recoil_Min_X 0.5
Recoil_Min_Y 3
Recoil_Max_X 1.5
Recoil_Max_Y 4

Recover_X 0.4
Recover_Y 0.4

Shake_Min_X -0.0025
Shake_Min_Y 0.0025
Shake_Min_Z -0.01
Shake_Max_X 0.0025
Shake_Max_Y -0.0025
Shake_Max_Z -0.02

Muzzle 3

This configuration demonstrates a standard NATO-pattern assault rifle: safety, semi-auto, and burst-fire modes; four attachment hooks (sight, tactical, grip, barrel); Caliber 1 for NATO 5.56mm magazine compatibility; moderate recoil with low shake; and a default sight (legacy ID 5) and magazine (legacy ID 6) pre-equipped.

Example 2: Heavy machine gun (Nykorev)

The Nykorev is a belt-fed light machine gun with automatic fire only and an Equipable_Movement_Speed_Multiplier that slows the player while equipped.

GUID cde96a85b86b4ea99389a83eaa603a32
Type Gun
Rarity Epic
Useable Gun
Slot Primary
ID 126

Size_X 5
Size_Y 2
Size_Z 0.3
Size2_Z 0.55

Sight 128
Magazine 127

Hook_Sight
Hook_Tactical
Hook_Grip
Hook_Barrel

Ammo_Min 30
Ammo_Max 200

Safety
Auto

Caliber 10

Equipable_Movement_Speed_Multiplier 0.95

Range 150
Firerate 5
Unplace 0.2
Replace 0.8
Action Trigger

Player_Damage 11
Zombie_Damage 33
Animal_Damage 11
Barricade_Damage 10
Structure_Damage 10
Vehicle_Damage 10
Resource_Damage 10
Object_Damage 10

Durability 0.125

Spread_Aim 0.1
Spread_Angle_Degrees 8.53

Recoil_Min_X -4
Recoil_Min_Y 4
Recoil_Max_X 2
Recoil_Max_Y 6

Recover_X 0.6
Recover_Y 0.6

Shake_Min_X -0.003
Shake_Min_Y 0.003
Shake_Min_Z -0.01
Shake_Max_X 0.003
Shake_Max_Y -0.003
Shake_Max_Z -0.02

Muzzle 3

This configuration demonstrates an LMG with only two fire modes (safe and auto), a large ammo capacity range (30-200 rounds), movement speed penalty (Equipable_Movement_Speed_Multiplier 0.95), and modified reload timing (Unplace 0.2 and Replace 0.8 for belt-fed reload animation timing).

Example 3: Bolt-action sniper rifle (Schofield)

The Schofield is a bolt-action sniper rifle with high per-shot damage, slow fire rate, and no attachment barrel hook.

GUID c9e5a852b9c14206b483e629ee33ade0
Type Gun
Rarity Uncommon
Useable Gun
Slot Primary
ID 101

Size_X 5
Size_Y 2
Size_Z 0.4
Size2_Z 0.8

Sight 102
Magazine 103

Hook_Sight
Hook_Tactical
Hook_Grip
Hook_Barrel

Ammo_Min 1
Ammo_Max 5

Safety
Semi

Caliber 5

Range 200
Firerate 50
Action Bolt

Player_Damage 80
Zombie_Damage 99
Animal_Damage 99
Barricade_Damage 25
Structure_Damage 20
Vehicle_Damage 30
Resource_Damage 20
Object_Damage 20

Durability 0.4

Spread_Aim 0.01
Spread_Angle_Degrees 11.31

Recoil_Min_X -8
Recoil_Min_Y 20
Recoil_Max_X 8
Recoil_Max_Y 25

Recover_X 0.3
Recover_Y 0.3

Shake_Min_X -0.005
Shake_Min_Y 0.005
Shake_Min_Z -0.05
Shake_Max_X 0.005
Shake_Max_Y -0.005
Shake_Max_Z -0.1

Muzzle 4

This configuration demonstrates a bolt-action weapon: Action Bolt for single-round chambering, high Firerate 50 (very slow rate of fire), high Player_Damage 80 and Zombie_Damage 99, narrow Spread_Aim 0.01 for precision shooting, and high recoil with slow recovery. The Ammo_Min 1 and Ammo_Max 5 produce a small magazine capacity consistent with a bolt-action sniper rifle.

Example 4: Rocket launcher (Launcher_Rocket)

The Launcher_Rocket uses Action Rocket for physics projectile behavior with area-of-effect explosions.

GUID af47bb9e0ba7443fa69435f1f594a10b
Type Gun
Rarity Legendary
Useable Gun
Slot Primary
ID 519

Size_X 4
Size_Y 2
Size_Z 0.45
Size2_Z 0.7

Sight 521
Magazine 520

Hook_Sight
Hook_Tactical
Hook_Grip

Ammo_Min 1
Ammo_Max 1

Safety
Semi

Caliber 20

Firerate 50
Replace 0.5
Action Rocket

Player_Damage 200
Zombie_Damage 200
Animal_Damage 200
Barricade_Damage 1000
Structure_Damage 1000
Vehicle_Damage 500
Resource_Damage 2000
Object_Damage 1000

Range 12
Explosion 45

Durability 1
Wear 5

Spread_Aim 0.1
Spread_Angle_Degrees 5.71

Ballistic_Force 2000

Recoil_Min_X -15
Recoil_Min_Y 25
Recoil_Max_X 15
Recoil_Max_Y 30

Recover_X 0.7
Recover_Y 0.7

Shake_Min_X -0.0025
Shake_Min_Y 0.0025
Shake_Min_Z -0.01
Shake_Max_X 0.0025
Shake_Max_Y -0.0025
Shake_Max_Z -0.02

This configuration demonstrates a physics-projectile rocket launcher: Action Rocket, Ballistic_Force 2000 for the projectile thrust, Range 12 as the explosion radius (not bullet range), Explosion 45 as the explosion effect, and extremely high damage values across all categories. The Ammo_Min 1 and Ammo_Max 1 limit the launcher to single-shot capacity.

Example 5: Jamming-enabled pistol (Cobra_Jam variant)

The Cobra_Jam configuration demonstrates the jamming system with a high jam probability curve.

GUID a5f36c8e14c04c0bb886ef2af1b523d7
Type Gun
Rarity Rare
Useable Gun
Slot Secondary
ID 1521

Can_Ever_Jam
Jam_Quality_Threshold 0.9
Jam_Max_Chance 0.5
Unjam_Chamber_Anim Reload

Master_Bundle_Override core.masterbundle
Bundle_Override_Path /Items/Guns/Cobra

Size_X 2
Size_Y 2
Size_Z 0.3
Size2_Z 0.35

Magazine 100

Hook_Barrel
Hook_Tactical

Ammo_Min 5
Ammo_Max 20

Safety
Semi
Auto

Caliber 4

Range 80
Firerate 4
Action Trigger

Player_Damage 25
Zombie_Damage 99
Animal_Damage 25
Barricade_Damage 12
Structure_Damage 12
Vehicle_Damage 25
Resource_Damage 15
Object_Damage 15

Durability 1
Wear 1

Spread_Aim 0.1
Spread_Angle_Degrees 16.7

Recoil_Min_X -6
Recoil_Min_Y 3
Recoil_Max_X 2
Recoil_Max_Y 4.5

Recover_X 0.2
Recover_Y 0.4

Shake_Min_X -0.005
Shake_Min_Y 0.005
Shake_Min_Z -0.05
Shake_Max_X 0.005
Shake_Max_Y -0.005
Shake_Max_Z -0.075

Muzzle 3

This configuration demonstrates jamming support via Can_Ever_Jam, Jam_Quality_Threshold 0.9 (jamming starts at 90% quality), Jam_Max_Chance 0.5 (50% maximum jam chance), and Unjam_Chamber_Anim Reload (uses the reload animation as the unjam animation since no dedicated UnjamChamber clip exists). Additionally, it uses Master_Bundle_Override core.masterbundle with Bundle_Override_Path to reference the core master bundle rather than a mod-specific bundle.

Frequently asked questions

What is the difference between ballistic and physics projectiles?

Ballistic projectiles use a deterministic step-based simulation controlled by Ballistic_Travel, Ballistic_Steps, and Bullet_Gravity_Multiplier. Physics projectiles use Unity's physics engine with a Rigidbody, controlled by Ballistic_Force, Projectile_Lifespan, and Projectile_Penetrate_Buildables. Ballistic projectiles produce no area-of-effect damage on their own; physics projectiles always detonate with an explosion on impact. Ballistic projectiles can function as hitscan when the ballistics setting is disabled on the server.

Which action types use which projectile system?

All action types except Rocket use the ballistic projectile system. Only Action Rocket uses the physics projectile system. This is a hard-coded mapping - configuring Ballistic_Force on a Trigger action weapon has no effect, and configuring Ballistic_Travel on a Rocket action weapon has no effect.

How does the magazine caliber array interact with the single Caliber field?

The Caliber field is used as a fallback when Magazine_Calibers is not configured (or is set to 0 or 1 with no Magazine_Caliber_# entries). When Magazine_Calibers is set to a value greater than 1 and corresponding Magazine_Caliber_# entries exist, those entries are read and the Caliber field is ignored for magazine compatibility. A gun can accept one caliber through the simple Caliber field or multiple calibers through the array.

What is the purpose of Attachment_Calibers?

Attachment_Calibers and Attachment_Caliber_# allow a gun to accept a different set of caliber IDs for hook attachments (sights, grips, tactical, barrels) than for magazines. A gun might accept NATO 5.56mm magazines (caliber 1) but accept only custom grips (caliber 5001). When Attachment_Calibers is not configured, it defaults to whatever Magazine_Calibers is set to, making attachment and magazine calibers identical.

Can I make a gun that has no attachments?

Yes. Omit all Hook_* flags. The gun will not have any attachment slots. The Barrel, Grip, Sight, Tactical, and Magazine child GameObjects in the prefab still need to exist for model positioning, but their hook flags are what control whether the player can equip or remove attachments in-game.

What happens if I omit the Action field?

The gun will not function. The Action field is required. Without it, the engine cannot determine which projectile system to use, which reload mechanic to apply, or which shell casing defaults to use. The gun will load into the inventory and display its model, but attempting to fire produces no behavior.

How do I make a gun that fires underwater?

Underwater firing is controlled by the game mode settings (the Allow_Fire_Underwater level configuration node), not by the gun asset. A gun with high spread and high recoil underwater is the result of the stance multiplier system applying Recoil_Swimming and Spread_Swimming, not a separate underwater capability flag. If the server disables underwater firing, no gun can fire regardless of its configuration.

How does Instakill_Headshots interact with zombie damage?

Instakill_Headshots applies only to player targets by default. Zombies are not instakilled by headshots unless the world difficulty configuration has Weapons_Use_Player_Damage enabled. When that setting is active, zombie damage is calculated using the player damage values and modifiers, and Instakill_Headshots applies to zombies as it would to players.

What does the Turret flag do?

The Turret flag tells the engine to treat the weapon as a vehicular turret. This affects the first-person viewmodel behavior while the weapon is held. The DriverTurretViewmodelMode field provides additional control over how the viewmodel interacts with the driver's perspective. Turret-flagged weapons are typically vehicle-mounted machine guns and cannons, not hand-held weapons.

How is the rate of fire calculated from Firerate?

The rate of fire in rounds per second (RPS) is 50 / (Firerate + 1). A weapon with Firerate 4 fires 50 / 5 = 10 RPS. A weapon with Firerate 50 fires 50 / 51 = 0.98 RPS (approximately one round per second). A weapon with Firerate 0 fires 50 / 1 = 50 RPS (the theoretical maximum).

What is the maximum range a gun can have?

The Range field is a float32, which can hold values up to approximately 3.4 × 10^38. In practice, values beyond approximately 1000 meters exceed any reasonable engagement distance in Unturned. The ballistic projectile system's Ballistic_Steps and Ballistic_Travel interaction imposes a practical constraint: if the projectile despawns before reaching the target (because Ballistic_Travel × Ballistic_Steps is less than the target distance), the shot misses regardless of Range. Configure both fields in tandem to match the intended gameplay envelope.

Can a gun have both ballistic and physics projectiles?

No. The Action field selects exactly one projectile system. A gun configured as Action Trigger uses ballistic projectiles exclusively. A gun configured as Action Rocket uses physics projectiles exclusively. There is no hybrid mode within a single asset.

What is the purpose of Magazine_Replacement_*?

The Magazine_Replacements system allows a gun to spawn with different default magazines on different maps. A gun that spawns with a standard 30-round magazine on most maps but loads with a 10-round magazine on a survival-themed map would use Magazine_Replacement_0_ID and Magazine_Replacement_0_Map. This is a map-conditional magazine system used by the vanilla spawn tables to give weapons regional variation.

Can I make a gun that never fires (a display prop)?

Yes. Set Firerate to a high value and configure no fire mode flags (omit Semi, Auto, and Safety). The gun will equip and display its model but cannot fire because no fire mode is available. For zero-damage functionality, also set all damage fields to 0. For a fully inert display prop, additionally set Allow_Magazine_Change false to prevent reload interactions.

What does Equipable_Movement_Speed_Multiplier do on a gun?

The Equipable_Movement_Speed_Multiplier field is inherited from ItemWeaponAsset and slows the player's movement speed while the weapon is equipped. It is distinct from Aiming_Movement_Speed_Multiplier, which applies only while aiming. The Nykorev LMG uses Equipable_Movement_Speed_Multiplier 0.95 to impose a 5% movement speed penalty while the LMG is equipped, reflecting the weapon's weight.

How do body-part multipliers affect damage calculations?

The Player_Leg_Multiplier, Player_Arm_Multiplier, Player_Spine_Multiplier, and Player_Skull_Multiplier fields (and their zombie and animal equivalents) multiply the base Player_Damage value by the multiplier for the hit body part. A shot to the head on a player with Player_Skull_Multiplier 1.1 and base Player_Damage 40 deals 44 damage. A shot to the leg with Player_Leg_Multiplier 0.6 deals 24 damage. These multipliers exist for all three humanoid target categories.

Best practices

  • Set Caliber to a custom value (5000+ range) for mod guns to avoid unintended compatibility with vanilla magazines. Use caliber 0 only for intentional universal compatibility.
  • Configure either Ballistic_Travel or Ballistic_Steps but not both to avoid range mismatch between the projectile simulation and the Range field.
  • Test jamming thresholds on a development server before shipping. A weapon that jams every few shots at 80% quality feels unreliable; a weapon that jams at 20% quality feels durable but occasionally malfunctioning.
  • Author Replace and Unplace values to match the reload animation timing in the Animator Controller. A mismatch between the .dat timing and the animation clip length produces visually incorrect magazine swapping (the new magazine appears before the reload animation reaches it).
  • Set all four Hook_* flags on a standard assault rifle to give players full attachment flexibility. Omit hooks only for deliberately minimalist weapons.
  • Use Ammo_Min and Ammo_Max to vary the starting ammunition in spawned weapons. A weapon that always spawns with a full magazine (Ammo_Min equals Amount) produces predictable loot; a weapon with variable starting ammo (Ammo_Min lower than Ammo_Max) creates loot variety.
  • Set Equipable_Movement_Speed_Multiplier below 1.0 for heavy weapons (LMGs, rocket launchers, anti-materiel rifles). Leave at 1.0 or omit for light weapons.
  • Configure Damage_Falloff_Range and Damage_Falloff_Max_Range to match the intended damage curve. A close-quarters weapon should have short falloff range; a sniper rifle should have long or no falloff.
  • Apply scale in Blender before FBX export. Non-unit scale on the mesh produces incorrect in-game size on the gun model.
  • Verify Firerate with the rate-of-fire formula before setting a value. A weapon with Firerate 200 has a theoretical rate of approximately 0.25 rounds per second, which may produce a disappointing firing feel.

Advanced considerations

Multi-caliber weapon design

A gun that accepts multiple caliber families (e.g., a survival rifle that fires both 5.56mm and .22 LR through barrel inserts) should configure both Magazine_Calibers and Attachment_Calibers arrays with the full set of accepted caliber IDs. The Unity prefab should have caliber-specific Magazine child GameObjects (Caliber_1, Caliber_14) to position each magazine type correctly in the magazine well. The weapon's ballistic performance (Ballistic_Travel, Ballistic_Steps, Bullet_Gravity_Multiplier) applies uniformly regardless of which caliber is loaded - the caliber-specific ballistic tuning comes from the magazine asset's Speed field, not from the gun.

Custom master bundle overrides

The Master_Bundle_Override and Bundle_Override_Path fields allow a gun asset to reference a prefab in a different master bundle than the default. The vanilla Cobra_Jam example uses this to reference the core master bundle while keeping the .dat file in a mod-specific folder. This pattern is useful when multiple weapons share a common prefab structure or when a weapon needs to override only the .dat configuration while using the vanilla model bundle.

Vehicle turret weapons

Weapons with the Turret flag behave differently in first-person view when mounted on a vehicle. The DriverTurretViewmodelMode controls whether the player's arms are visible. When authoring a turret weapon, set Slot Primary and verify that the prefab hierarchy uses the same child GameObject structure (Barrel, Grip, Sight, Tactical, Magazine, Eject) as a hand-held weapon. The engine applies the turret viewmodel logic based on the vehicle's seat configuration, not on the weapon asset itself.

Weapon durability and quality interactions

The Durability field (inherited from ItemWeaponAsset) interacts with the jamming system when Can_Ever_Jam is set. As the weapon's quality drops due to use (governed by Wear), the jamming probability increases linearly below Jam_Quality_Threshold. A non-jamming weapon with low Durability simply becomes less effective visually; a jamming-enabled weapon with low durability becomes mechanically unreliable. The Invulnerable flag (also inherited from ItemWeaponAsset) prevents durability loss entirely, making the weapon indestructible.

Appendix A: Gun asset .dat quick-reference card

CategoryFieldTypeRequiredDefault
IdentityIDuint16Yes,
IdentityGUIDuint128Yes,
IdentityTypeenum (Gun)Yes,
IdentityUseableenum (Gun)Yes,
IdentityNamestringYes,
IdentityRarityenumNoCommon
IdentitySlotenumYes,
IdentitySize_Xuint8Yes,
IdentitySize_Yuint8Yes,
FiringActionEActionYes,
FiringAutoflagNonot set
FiringSemiflagNonot set
FiringSafetyflagNonot set
FiringBurstsint32No0
FiringFirerateuint8No0
FiringFire_Delay_Secondsint32No0
CaliberCaliberuint16No0
CaliberMagazine_Calibersint32No1
CaliberMagazine_Caliber_#uint16No0
CaliberAttachment_Calibersint32No(see Magazine_Calibers)
CaliberAttachment_Caliber_#uint16No0
CaliberRequires_NonZero_Attachment_CaliberboolNofalse
HooksHook_SightflagNonot set
HooksHook_GripflagNonot set
HooksHook_TacticalflagNonot set
HooksHook_BarrelflagNonot set
HooksSightuint16No0
HooksGripuint16No0
HooksTacticaluint16No0
HooksBarreluint16No0
MagazineAllow_Magazine_ChangeboolNotrue
MagazineAmmo_Minuint8No0
MagazineAmmo_Maxuint8No0
MagazineAmmo_Per_Shotuint8No1
MagazineMagazineuint16No0
MagazineMagazine_Replacementsint32No0
MagazineMagazine_Replacement_#_IDuint16No0
MagazineMagazine_Replacement_#_MapstringNo(empty)
MagazineInfinite_AmmoboolNofalse
MagazineReload_Timefloat32No1
MagazineReplacefloat32No1
MagazineUnplacefloat32No0
MagazineHammer_Timefloat32No1
MagazineShould_Delete_Empty_MagazinesboolNo(see Action default)
BallisticBallistic_Stepsuint8NoRange / Ballistic_Travel
BallisticBallistic_Travelfloat32No10
BallisticBullet_Gravity_Multiplierfloat32No4
PhysicsBallistic_Forcefloat32No0.002
PhysicsProjectile_Explosion_Launch_Speedfloat32NoPlayer_Damage × 0.1
PhysicsProjectile_Lifespanfloat32No30
PhysicsProjectile_Penetrate_BuildablesflagNonot set
DamageDamage_Falloff_Rangefloat32No1
DamageDamage_Falloff_Max_Rangefloat32No1
DamageDamage_Falloff_Multiplierfloat32No1
DamageInstakill_HeadshotsboolNofalse
EffectsMuzzleGUID/uint16No0
EffectsShellGUID/uint16No(see Action default)
EffectsExplosionGUID/uint16No0
JammingCan_Ever_JamflagNonot set
JammingJam_Quality_Thresholdfloat32No0.4
JammingJam_Max_Chancefloat32No0.1
JammingUnjam_Chamber_AnimstringNoUnjamChamber
RecoilRecoil_Min_Xfloat32No0
RecoilRecoil_Max_Xfloat32No0
RecoilRecoil_Min_Yfloat32No0
RecoilRecoil_Max_Yfloat32No0
RecoilRecover_Xfloat32No0
RecoilRecover_Yfloat32No0
RecoilAiming_Recoil_Multiplierfloat32No1
RecoilRecoil_Crouchfloat32No0.85
RecoilRecoil_Pronefloat32No0.7
RecoilRecoil_Sprintfloat32No1.25
RecoilRecoil_Swimmingfloat32No1.1
RecoilRecoil_Midairfloat32No1.0
ShakeShake_Min_Xfloat32No0
ShakeShake_Max_Xfloat32No0
ShakeShake_Min_Yfloat32No0
ShakeShake_Max_Yfloat32No0
ShakeShake_Min_Zfloat32No0
ShakeShake_Max_Zfloat32No0
SpreadSpread_Aimfloat32No0
SpreadSpread_Angle_Degreesfloat32No0
SpreadSpread_Crouchfloat32No0.85
SpreadSpread_Pronefloat32No0.7
SpreadSpread_Sprintfloat32No1.25
SpreadSpread_Swimmingfloat32No1.1
SpreadSpread_Midairfloat32No1.5
UncategorizedAim_In_Durationfloat32No0.2
UncategorizedAiming_Movement_Speed_Multiplierfloat32No(see Can_Aim_During_Sprint)
UncategorizedAlert_Radiusfloat32No48
UncategorizedCan_Aim_During_SprintboolNofalse
UncategorizedGunshot_Rolloff_Distancefloat32No(see Action default)
UncategorizedMust_Aim_To_ShootboolNo(see Action default)
UncategorizedRange_Rangefinderfloat32No(see Range)
UncategorizedScale_Aim_Animation_SpeedboolNotrue
UncategorizedStop_Aiming_After_ShootingboolNofalse
UncategorizedDriverTurretViewmodelModeenumNoOffscreenWhileAiming
TurretTurretflagNonot set
RechamberRechamberAfterMagazineAttachedenumNoIfAmmoWasEmpty
RechamberRechamberAfterMagazineDetachedenumNoAlways
RechamberRechamberAfterShotCountint32No(see Action default)
RechamberRechamberAfterShotDelayfloat32No0.25
RechamberCasingEjectCountAfterRechamberingAfterShootingint32No1
RechamberCasingEjectCountAfterReloadint32No(see Action default)
RechamberEjectAfterHammerDelayfloat32No0.45
RechamberEjectAfterReloadDelayfloat32No0.5
RechamberEjectCasingAfterShootingboolNo(see Action default)
BundleMaster_Bundle_OverridestringNo(empty)
BundleBundle_Override_PathstringNo(empty)

Appendix B: Action type projectile system and reload comparison

The table below summarizes the relationship between each EAction value, its projectile system, reload type, and notable default field values.

ActionProjectile systemReload typeEject casing defaultDelete empty mag defaultRechamberAfterShotCount defaultGunshot rolloff default
TriggerBallisticFull swapTrueFalse0512
BoltBallisticSingle-round,,1512
PumpBallisticSingle-round,True1512
RailBallisticSingle-round,True,512
StringBallisticSingle-round,True,16
BreakBallisticSingle-round,True,512
RocketPhysicsSingle-round,True,64
MinigunBallisticFull swapTrue,,512

Appendix C: Attachment compatibility matrix

The table below shows which attachment slot types each gun type commonly supports and which fields enable compatibility.

Attachment typeHook flag fieldDefault attachment fieldCaliber matchingPrefab child
Sight (optic)Hook_SightSightAttachment_Caliber_#Sight
Grip (foregrip)Hook_GripGripAttachment_Caliber_#Grip
Tactical (laser, flashlight, rangefinder)Hook_TacticalTacticalAttachment_Caliber_#Tactical
Barrel (muzzle brake, suppressor)Hook_BarrelBarrelAttachment_Caliber_#Barrel

Appendix D: Diagnostic table

SymptomMost likely causeResolution
Gun does not appear in inventory after @giveID mismatch, Bypass_ID_Limit missing, or folder path wrongConfirm ID is unique; add Bypass_ID_Limit True if ID > 2000; check folder path
Gun appears but cannot be equippedUseable Gun missing or Slot not configuredAdd Useable Gun and set Slot Primary, Secondary, or Tertiary
Gun equips but does not fire on trigger pullAction field missing or fire mode flags not setAdd Action Trigger (or appropriate action) and at least one fire mode flag (Semi or Auto)
Gun fires but no projectile is visibleMagazine caliber mismatch or Caliber not matching magazineConfirm Caliber on gun matches Caliber_Reference on magazine
Attachment cannot be equipped on the gunHook flag for that slot type is missingAdd Hook_Sight, Hook_Grip, Hook_Tactical, or Hook_Barrel as appropriate
Attachment equips but floats at wrong positionCaliber-specific child position missing in prefabAdd Caliber_# child under the attachment's GameObject in the prefab
Reload animation does not playReload animation state missing from Animator ControllerAdd the Reload animation state matching the clip name
Shell casing does not ejectEjectCasingAfterShooting set to false or Eject child missingSet EjectCasingAfterShooting true; confirm Eject child GameObject in prefab
Weapon fires too fast or too slowFirerate set to incorrect valueUse 50 / (Firerate + 1) to calculate rounds per second; tune accordingly
No muzzle flashMuzzle field not set or effect ID invalidSet Muzzle to a valid effect GUID or legacy ID (vanilla: 3 for rifles, 4 for heavy)
Weapon makes no soundGunshot_Rolloff_Distance too low or Shoot Audio Clip missingIncrease rolloff distance; add Shoot Audio Clip to prefab
Weapon jams on every shotCan_Ever_Jam set with low qualityConfirm Jam_Quality_Threshold and Jam_Max_Chance are appropriate; add an UnjamChamber_Anim state or set Unjam_Chamber_Anim Reload
Damage does not decrease at rangeDamage_Falloff_Range and Damage_Falloff_Max_Range both at default 1Set Damage_Falloff_Range 0.3 to start falloff at 30% of Range; set Damage_Falloff_Multiplier 0.25 for 75% reduction at max range
Player moves too slowly with weapon equippedEquipable_Movement_Speed_Multiplier set below 1.0 unintentionallySet Equipable_Movement_Speed_Multiplier 1.0 or omit the field
Headshots do not kill players instantlyInstakill_Headshots not set or set to falseAdd Instakill_Headshots True to the .dat

Authoring checklist

Before publishing a gun mod to the Steam Workshop, confirm the following:

  • [ ] GUID is unique - generated fresh, not copied from another asset
  • [ ] ID is in the 50000+ range
  • [ ] Type Gun and Useable Gun are present
  • [ ] Action is set to the correct EAction value for the weapon type
  • [ ] At least one fire mode flag (Safety, Semi, Auto, Bursts) is present
  • [ ] Caliber (or Magazine_Calibers array) matches the intended magazine caliber
  • [ ] Hook_* flags are present for every intended attachment slot type
  • [ ] Prefab has all six child GameObjects (Barrel, Grip, Sight, Tactical, Magazine, Eject)
  • [ ] Animator Controller has states for Reload, Hammer, and UnjamChamber (if jamming is enabled)
  • [ ] Ballistic_Travel and Ballistic_Steps are not both manually configured (range mismatch risk)
  • [ ] Firerate is calculated using the 50 / (Firerate + 1) formula
  • [ ] Replace and Unplace values match reload animation timing
  • [ ] Scale has been applied in Blender before FBX export
  • [ ] Master bundle is built and copied to the mod's Bundles/ folder
  • [ ] English.dat is authored with Name and Description fields
  • [ ] Tested in single-player: model visible, fires, reloads, attachments equip correctly
  • [ ] Tested caliber linkage with at least one magazine
  • [ ] Tested all fire modes cycle correctly
  • [ ] Tested jamming behavior if Can_Ever_Jam is set

Document history

VersionDateAuthorNotes
1.02026-07-2657 StudiosInitial publication. Complete gun asset field reference covering all 14 property tables, 4 enumerations, both projectile systems, attachment compatibility, jamming system, NPC rewards, 5 worked .dat examples, and full FAQ.

Cross-references