Attachment Slots: Sight, Grip, Tactical, Barrel
Intermediate40-60 minutesWindowsUnity EditorBlenderNotepad++
Attachment slots are the configuration layer that lets players and modders extend a firearm's behavior without altering the base gun asset. An attachment that does not seat correctly, references the wrong slot type, or has a misplaced hook on the weapon prefab will either refuse to equip at all or will float visually at the wrong position — both of which are common first-time errors that take disproportionate debugging time to find.
This reference covers all four attachment slot types in the 57 Studios™ modding documentation for Unturned™: Sight, Grip, Tactical, and Barrel. For each slot, the article documents the full set of .dat fields, the correct Unity prefab hook name, the relationship between the attachment's slot type and the weapon's hook GameObject, the caliber compatibility system, and the per-slot pro variant configuration. A compatibility table, a full authoring checklist, and a common-mistake diagnostic section close the article.
Modders who are building a gun mod from scratch should read Gun Mod Tutorial first. This article assumes the gun prefab is built and the base gun .dat is authored.

What you will learn
- The four attachment slot types and what each one governs in gameplay.
- The
.datfields required on the attachment side for each slot type. - The
.datfields required on the gun side to enable each slot. - How to position each hook GameObject in Unity for correct visual and functional behavior.
- How the caliber compatibility system restricts which attachments a gun accepts.
- How Pro variant configuration works for each slot.
- A complete authoring workflow, checklist, and diagnostic table for the most common slot errors.
How the attachment system works
Unturned™'s attachment system is a two-sided linkage. The gun specifies which attachment slots exist on it (by whether the corresponding .dat field is present) and which hook GameObjects exist in its prefab. The attachment specifies which slot type it occupies. At runtime, the engine checks that the attachment's slot type matches a supported slot on the gun, that caliber compatibility passes, and that the named hook GameObject exists in the weapon prefab.
Gun.dat
Sight [uint16 default ID] ──► Hook_Sight (GameObject in prefab)
Grip [uint16 default ID] ──► Hook_Grip (GameObject in prefab)
Tactical [uint16 default ID] ──► Hook_Tactical (GameObject in prefab)
Barrel [uint16 default ID] ──► Hook_Barrel (GameObject in prefab)If a hook GameObject is missing from the prefab, the attachment equips as an item effect but has no visual representation — the attachment "works" statistically but appears invisible. If the hook exists but is at the wrong position, the attachment snaps to the wrong location on the weapon. Both are considered bugs.
Attachment linkage sequence
Pro tip
Author all four hook GameObjects (Hook_Sight, Hook_Grip, Hook_Tactical, Hook_Barrel) in every gun prefab, even if the gun will not ship with all four slots enabled in its .dat. Adding the hooks to the prefab costs nothing and makes future attachment support a .dat change rather than a bundle rebuild.
Attachment slot state transitions
Each slot on a gun can be in one of three states at any given time: empty (no attachment equipped), occupied (attachment installed), or restricted (slot not declared in .dat). The following diagram shows the valid transitions between states and what triggers each:
Understanding these transitions matters when designing loot table behavior. A gun with Sight 0 spawns in the Empty state; a gun with Sight 4001 spawns in the Occupied state with item 4001 installed. The player can always move the slot from Occupied back to Empty by removing the attachment; the attachment drops as a separate inventory item.
Slot type enum reference
| Slot type string | Used in field | Slot purpose |
|---|---|---|
Sight | Type Sight in attachment .dat | Optics and iron sights. Occupies Hook_Sight. |
Grip | Type Grip in attachment .dat | Foregrips and vertical grips. Occupies Hook_Grip. |
Tactical | Type Tactical in attachment .dat | Flashlights, lasers, combo lights. Occupies Hook_Tactical. |
Barrel | Type Barrel in attachment .dat | Suppressors, compensators, flash hiders. Occupies Hook_Barrel. |
Sight slot
The Sight slot is the most-requested attachment type in community modding. It controls what optic or iron sight the player sees when aiming down sights (ADS). A sight attachment replaces the default iron sight alignment with its own Distance parameter and optional zoom.
Sight .dat fields
| Field | Type | Required | Default | Purpose |
|---|---|---|---|---|
ID | uint16 | Yes | — | Unique item ID. Choose 50000+ to avoid collisions. |
GUID | uint128 | Yes | — | 128-bit GUID. Generate with any UUID tool; remove hyphens. |
Type | enum | Yes | — | Must be Sight. |
Name | string | Yes | — | Internal name (no spaces). |
Rarity | enum | Yes | Common | Common, Uncommon, Rare, Epic, Legendary, Mythical. |
Slot | enum | Yes | — | Must be None (attachments do not occupy a primary/secondary slot). |
Size_X | uint8 | Yes | — | Inventory grid width. |
Size_Y | uint8 | Yes | — | Inventory grid height. |
Caliber | uint16 | Yes | 0 | Caliber compatibility. Must match gun's Caliber to equip. 0 = universal. |
Distance | float | No | 200 | The ADS focus distance in meters. Affects the sight picture's focal plane. |
Zoom | float | No | 1.0 | The magnification multiplier in ADS. 1.0 = no zoom. 4.0 = 4× zoom. |
Ballistic_Drop | float | No | — | Override the gun's ballistic drop when this sight is equipped. |
Ballistic_Steps | uint8 | No | — | Override the gun's ballistic steps when this sight is equipped. |
Spread_Multiplier_ADS | float | No | 1.0 | Multiplier on Spread_Aim when this sight is equipped. Values below 1.0 tighten spread. |
Recoil_X | float | No | 1.0 | Multiplier on horizontal recoil when this sight is equipped. |
Recoil_Y | float | No | 1.0 | Multiplier on vertical recoil when this sight is equipped. |
Holographic | flag | No | absent | When present, the sight uses the holographic reticle rendering path rather than the scope rendering path. |
Night_Vision | flag | No | absent | When present, the sight activates night-vision post-processing when ADS. |
Shake | flag | No | absent | When present, a camera shake is applied while the sight is equipped. |
Pro | flag | No | absent | When present, the attachment is included in the Pro variant drop pool. |
Sight .dat example
ID 50001
GUID a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
Type Sight
Name MyScope_4x
Rarity Uncommon
Slot None
Size_X 2
Size_Y 1
Caliber 0
Distance 200
Zoom 4.0
Spread_Multiplier_ADS 0.7
Recoil_X 0.9
Recoil_Y 0.9Sight hook placement
The Hook_Sight GameObject must be positioned on the weapon prefab at the location where the optic base will mount — typically at the top of the receiver rail. Its forward axis should align with the weapon's bore line.
Common mistake
Placing Hook_Sight at the muzzle flash position instead of the receiver rail. The muzzle and the sight rail are different points on the weapon. A scope mounted at the muzzle position will appear to float 40–60 cm in front of the weapon in-game.
Zoom values by optic type
| Optic class | Recommended Zoom | Recommended Distance |
|---|---|---|
| Iron sight | 1.5 | 100 |
| Red dot / reflex | 1.75 | 150 |
| Holographic | 1.75 | 150 |
| 2× short-range scope | 2.0 | 200 |
| 4× mid-range scope | 4.0 | 300 |
| 8× long-range scope | 8.0 | 500 |
| 16× extreme-range scope | 16.0 | 800 |

Grip slot
The Grip slot controls foregrips and vertical grips that modify the weapon's recoil profile and spread characteristics. A grip does not change the weapon's visual aim behavior — it changes the statistical output of each shot.
Grip .dat fields
| Field | Type | Required | Default | Purpose |
|---|---|---|---|---|
ID | uint16 | Yes | — | Unique item ID. |
GUID | uint128 | Yes | — | 128-bit GUID. |
Type | enum | Yes | — | Must be Grip. |
Name | string | Yes | — | Internal name. |
Rarity | enum | Yes | Common | Rarity tier. |
Slot | enum | Yes | — | Must be None. |
Size_X / Size_Y | uint8 | Yes | — | Inventory footprint. |
Caliber | uint16 | Yes | 0 | Caliber compatibility. 0 = universal. |
Recoil_X | float | No | 1.0 | Multiplier on horizontal recoil. Values below 1.0 reduce horizontal kick. |
Recoil_Y | float | No | 1.0 | Multiplier on vertical recoil. Values below 1.0 reduce muzzle rise. |
Spread | float | No | 1.0 | Multiplier on Spread_Hip. Values below 1.0 tighten hip-fire spread. |
Sway | float | No | 1.0 | Multiplier on weapon sway while held. Values below 1.0 steady the weapon. |
Aiming_Movement_Speed_Multiplier | float | No | 1.0 | Multiplier on movement speed while ADS. Values below 1.0 slow ADS movement. |
Pro | flag | No | absent | Pro variant eligibility. |
Grip .dat example
ID 50010
GUID b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7
Type Grip
Name MyVerticalGrip
Rarity Common
Slot None
Size_X 1
Size_Y 2
Caliber 0
Recoil_X 0.85
Recoil_Y 0.80
Spread 0.90
Sway 0.80Grip hook placement
The Hook_Grip GameObject must be positioned at the underside of the weapon's fore-end or handguard rail — the physical location where a vertical foregrip would attach. Its local Y axis should point downward (away from the bore line).
Pro tip
Most rifles use a standard Picatinny rail section under the handguard. Position Hook_Grip approximately 15–20 cm behind the muzzle along the bore axis and 3–4 cm below it. Match the vanilla AK or M4 prefab positioning for a realistic reference baseline.
Grip balance reference
| Grip class | Recoil_X | Recoil_Y | Spread | Sway |
|---|---|---|---|---|
| Stub foregrip (minimal) | 0.95 | 0.95 | 0.95 | 0.95 |
| Vertical foregrip (standard) | 0.85 | 0.80 | 0.90 | 0.80 |
| Angled foregrip | 0.90 | 0.85 | 0.95 | 0.85 |
| Bipod (deployed) | 0.60 | 0.55 | 0.70 | 0.50 |
| Weighted handguard | 0.88 | 0.88 | 0.88 | 0.88 |
Balance consideration
Combining a grip with Recoil_Y 0.55 and a barrel with negative recoil modifiers can produce a gun that is statistically superior to every vanilla weapon of the same class. The 57 Studios™ cohort recommendation is to tune grips so that the modified gun outperforms the unmodified version by 10–20%, not 40–50%.
Tactical slot
The Tactical slot covers flashlights, laser sights, and combined light/laser units. A tactical attachment can project a visible light cone, a visible laser dot, or both. The projection characteristics are controlled by .dat fields, not by the Unity prefab's light component — the game engine handles the light rendering from the .dat data.
Tactical .dat fields
| Field | Type | Required | Default | Purpose |
|---|---|---|---|---|
ID | uint16 | Yes | — | Unique item ID. |
GUID | uint128 | Yes | — | 128-bit GUID. |
Type | enum | Yes | — | Must be Tactical. |
Name | string | Yes | — | Internal name. |
Rarity | enum | Yes | Common | Rarity tier. |
Slot | enum | Yes | — | Must be None. |
Size_X / Size_Y | uint8 | Yes | — | Inventory footprint. |
Caliber | uint16 | Yes | 0 | Caliber compatibility. 0 = universal. |
Light | flag | No | absent | When present, the attachment projects a flashlight cone. |
Laser | flag | No | absent | When present, the attachment projects a visible laser dot. |
Rangefinder | flag | No | absent | When present, the attachment shows range to crosshair target in the HUD. |
Spotlight | flag | No | absent | When present, a high-intensity directional spotlight is used instead of a standard flashlight cone. |
Pro | flag | No | absent | Pro variant eligibility. |
Tactical .dat example — laser/light combo
ID 50020
GUID c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8
Type Tactical
Name MyLaserLight
Rarity Uncommon
Slot None
Size_X 2
Size_Y 1
Caliber 0
Light
LaserTactical .dat example — rangefinder
ID 50021
GUID d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9
Type Tactical
Name MyRangefinder
Rarity Rare
Slot None
Size_X 2
Size_Y 1
Caliber 0
RangefinderTactical hook placement
The Hook_Tactical GameObject must be positioned on the weapon's underside rail, typically 8–12 cm behind the muzzle. For rifles with a long handguard, position it at the midpoint of the handguard. The forward axis should align with the bore direction — the light cone and laser beam project along this axis.
Common mistake
Placing Hook_Tactical at the same position as Hook_Grip. A weapon that has both a foregrip and a flashlight will have both attachments competing for the same rail position, visually intersecting. Hook_Tactical should be approximately 5–8 cm closer to the muzzle than Hook_Grip.
Tactical attachment behavior matrix
| Field present | Visual result | Gameplay effect |
|---|---|---|
Light only | White flashlight cone in front of weapon | Illuminates dark areas for the user and nearby players |
Laser only | Thin laser beam, dot on surface | Dot visible to all players including enemies |
Light + Laser | Both cone and beam | Dual functionality |
Rangefinder only | No visible projection | HUD range readout to crosshair target |
Spotlight only | Narrow high-intensity cone | Longer-range illumination; narrower than flashlight |
Laser visibility
The Laser flag makes the beam visible to all players on the server, including enemy players. This is intentional gameplay design. Document this clearly in your mod's Steam Workshop description so players know the laser betrays their position.
Barrel slot
The Barrel slot is the most statistically powerful attachment slot. Barrel attachments (suppressors, compensators, flash hiders, muzzle brakes) can modify the weapon's spread, recoil, range, audio category, and muzzle flash visibility simultaneously.
Barrel .dat fields
| Field | Type | Required | Default | Purpose |
|---|---|---|---|---|
ID | uint16 | Yes | — | Unique item ID. |
GUID | uint128 | Yes | — | 128-bit GUID. |
Type | enum | Yes | — | Must be Barrel. |
Name | string | Yes | — | Internal name. |
Rarity | enum | Yes | Common | Rarity tier. |
Slot | enum | Yes | — | Must be None. |
Size_X / Size_Y | uint8 | Yes | — | Inventory footprint. |
Caliber | uint16 | Yes | 0 | Caliber compatibility. Must match gun's Caliber or be 0 for universal. |
Durability | float | No | 1.0 | The barrel's durability. Reduces over shots fired. |
Spread | float | No | 1.0 | Multiplier on gun's Spread_Hip and Spread_Aim. |
Ballistic_Drop | float | No | — | Override the gun's ballistic drop when this barrel is equipped. |
Ballistic_Steps | uint8 | No | — | Override the gun's ballistic steps. |
Recoil_X | float | No | 1.0 | Multiplier on horizontal recoil. |
Recoil_Y | float | No | 1.0 | Multiplier on vertical recoil. |
Braked | flag | No | absent | When present, the muzzle blast is redirected (muzzle brake / compensator behavior). Reduces Recoil_Y. |
Silenced | flag | No | absent | When present, the audio category is switched to the silenced variant and muzzle flash is suppressed. |
Volume | float | No | 1.0 | Multiplier on the gun's fire audio volume. Values below 1.0 reduce volume. Has no effect without Silenced. |
Pro | flag | No | absent | Pro variant eligibility. |
Barrel .dat example — suppressor
ID 50030
GUID e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0
Type Barrel
Name MySuppressor
Rarity Rare
Slot None
Size_X 3
Size_Y 1
Caliber 0
Spread 1.05
Recoil_Y 0.90
Silenced
Volume 0.3
Durability 0.98Barrel .dat example — compensator
ID 50031
GUID f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1
Type Barrel
Name MyCompensator
Rarity Uncommon
Slot None
Size_X 2
Size_Y 1
Caliber 0
Spread 1.0
Recoil_X 0.80
Recoil_Y 0.85
BrakedBarrel hook placement
The Hook_Barrel GameObject must be positioned at the muzzle threading of the weapon — the forward tip of the barrel. Its forward axis must align with the bore direction. The barrel attachment model will extend forward from this point.
Common mistake
Setting Hook_Barrel at the midpoint of the barrel rather than at the muzzle tip. A suppressor mounted at the barrel midpoint will overlap the barrel geometry visually and extend only halfway past the muzzle. Position Hook_Barrel at the physical barrel exit.
Barrel balance reference
| Barrel class | Spread | Recoil_X | Recoil_Y | Silenced |
|---|---|---|---|---|
| Flash hider | 0.95 | 1.0 | 1.0 | absent |
| Muzzle brake | 1.05 | 0.75 | 0.85 | absent |
| Compensator | 1.0 | 0.80 | 0.80 | absent |
| Lightweight suppressor | 1.05 | 1.0 | 0.95 | present |
| Heavy suppressor | 1.10 | 1.0 | 0.90 | present |
| Barrel extension | 0.98 | 1.0 | 1.0 | absent |
Suppressor audio behavior
When Silenced is present, Unturned™ switches the gun's fire audio from its configured Shoot category to the corresponding suppressed audio category. The suppressed audio categories are internal to the engine. If the gun uses a custom Shoot audio category without a corresponding suppressed variant, the audio will fall back to the default suppressed tone, which may not match the gun's character.
Pro tip
If authoring a suppressor for a gun with a custom audio category, also author a suppressed audio variant bundle. See Audio Packaging for Unturned for the workflow. Without a matching suppressed variant, the gun will sound generic when suppressed regardless of the custom fire audio.
Suppressor durability curve
The cohort-validated durability curve for a suppressor is Durability 0.97 — the suppressor loses 3% of one durability unit per shot. At this rate a suppressor survives approximately 33 shots per durability unit. For a suppressor with the default maximum durability, this yields a realistic service life without degrading so fast that the attachment feels disposable.
Barrel attachment decision tree
Use the following decision tree when choosing which barrel type to author for a weapon mod:
Caliber compatibility system
Caliber compatibility is the mechanism by which the game restricts which attachments can be equipped on which guns. The system uses a simple integer match: the gun's Caliber field must equal the attachment's Caliber field. If either value is 0, the attachment is treated as universal and can be equipped on any gun regardless of caliber.
Caliber compatibility table for common vanilla calibers
| Gun caliber value | Compatible attachments |
|---|---|
0 | Any attachment with Caliber 0 or Caliber 0 |
1 (9mm class) | Attachments with Caliber 1 or Caliber 0 |
2 (5.56mm class) | Attachments with Caliber 2 or Caliber 0 |
3 (7.62mm class) | Attachments with Caliber 3 or Caliber 0 |
4 (12 gauge class) | Attachments with Caliber 4 or Caliber 0 |
| Custom (50000+) | Attachments with matching custom caliber or Caliber 0 |
Pro tip
When authoring a full mod weapon family (e.g., a pistol, SMG, and carbine that all fire the same round), assign all three guns the same custom Caliber value (e.g., 50001) and author all barrel/grip/sight attachments with that same caliber. This creates a consistent attachment ecosystem without interfering with vanilla weapon attachment pools.
Per-slot prefab hook reference
| Slot type | Required hook name | Position reference | Forward axis |
|---|---|---|---|
| Sight | Hook_Sight | Top of receiver rail | Bore direction |
| Grip | Hook_Grip | Underside of handguard | Downward from bore |
| Tactical | Hook_Tactical | Underside rail, mid-handguard | Bore direction |
| Barrel | Hook_Barrel | Muzzle tip | Bore direction |
| Magazine | Hook_Magazine | Magazine well | Downward |
The hook names are case-sensitive. hook_sight will not work; Hook_Sight is required. Confirm the casing in the Unity hierarchy before building the bundle.
Case sensitivity
Unity's hierarchy is case-sensitive for runtime name lookups. A hook named hook_barrel (lowercase h) will not be found by the runtime. Use the exact capitalization in the table above.

Hook positioning diagram
The following diagram illustrates the approximate physical location of each hook on a standard rifle geometry, moving from stock to muzzle:
For pistols the geometry is compressed — the sight hook sits atop the slide, the grip hook is absent (pistols rarely have fore-grip rails), and the barrel hook is at the muzzle of the shorter barrel. The tactical hook on a pistol typically sits on the dust-cover rail below the barrel.
Pistol vs. rifle hook positions
Pistols frequently omit Hook_Grip entirely because no foregrip attaches to a pistol frame in standard gameplay. Include Hook_Grip in the pistol prefab if the design calls for an exotic foregrip variant, but omit the Grip field from the .dat to keep the slot hidden from players.
Pro variant configuration
Pro variants are enhanced cosmetic (and occasionally statistical) versions of attachments that appear in the Pro drop pool. Enabling Pro on an attachment adds it to the drop pool without removing it from normal loot tables.
| Field | Behavior |
|---|---|
Pro (flag, no value) | Item is included in the Pro drop pool |
Absent Pro flag: item only appears in normal loot tables and direct spawning. Pro variants do not require separate .dat files; they are flagged variants of the same item.
Common mistakes diagnostic table
| Symptom | Most likely cause | Resolution |
|---|---|---|
| Attachment equips but is invisible | Hook GameObject missing from prefab | Add Hook_<Type> to prefab, rebuild bundle |
| Attachment refuses to equip at all | Caliber mismatch between gun and attachment | Set attachment Caliber 0 (universal) or match gun caliber value |
| Attachment equips at wrong position | Hook at wrong local position in prefab | Reposition hook in Unity, rebuild bundle |
| Attachment equips at wrong angle | Hook forward axis not aligned with bore | Rotate hook to align forward axis with bore |
| Two attachments interpenetrate visually | Hooks at same or overlapping positions | Separate hook positions: tactical 5–8 cm ahead of grip |
| Suppressor equips but gun still sounds loud | Silenced flag absent from barrel .dat | Add Silenced flag to barrel .dat |
| Scope zoom does not activate | Zoom field absent or set to 1.0 | Set Zoom to desired magnification value (e.g., 4.0) |
| Laser invisible in-game | Laser flag absent from tactical .dat | Add Laser flag to tactical .dat |
| Flashlight invisible in-game | Light flag absent from tactical .dat | Add Light flag to tactical .dat |
| Grip has no effect on recoil | Recoil_X and Recoil_Y both 1.0 | Set values below 1.0 to reduce recoil |
| Barrel causes spread to widen instead of tighten | Spread value above 1.0 | Set Spread below 1.0 (e.g., 0.9) to tighten |
| Night vision scope does not activate | Night_Vision flag absent | Add Night_Vision flag to sight .dat |
| Rangefinder shows no distance | Rangefinder flag absent | Add Rangefinder flag to tactical .dat |
Full attachment authoring workflow
Frequently asked questions
Can one attachment occupy multiple slots at once?
No. Each attachment has exactly one Type field and occupies exactly one slot. An attachment that claims to be both Sight and Tactical is not a supported configuration. The cohort workaround for a scope with a laser (a common real-world configuration) is to author them as two separate attachments — a scope for the Sight slot and a laser for the Tactical slot — and to let players equip both.
Can a gun have no attachment slots at all?
Yes. If the gun's .dat omits all four attachment fields (Sight, Grip, Tactical, Barrel), the gun accepts no attachments. This is a valid design choice for single-shot melee-range weapons, certain special weapons, or early-game items intended to be stat-neutral.
How do I make a suppressor that only fits my custom gun?
Set both the gun's Caliber field and the suppressor's Caliber field to the same custom value (use a value above 50000 to avoid vanilla collisions). Any other attachment with Caliber 0 will still be compatible with the gun. If you want a fully exclusive suppressor, set the gun's caliber to a unique custom value and set the suppressor to the same value with no other attachments sharing that value.
What is the Durability field on barrel attachments?
Durability controls how quickly the barrel attachment degrades from use. A value of 1.0 means the attachment loses 1 durability point per relevant action. A value of 0.5 means it degrades at half the rate. A value of 0.0 means the attachment is indestructible. The default is 1.0. Suppressors typically use a lower durability value to model erosion of the suppressor baffles over time.
Does the Holographic flag on a sight change any statistics?
No. The Holographic flag only changes the rendering path for the optic — it switches from the standard scope overlay to the holographic overlay. There is no statistical difference. Use it when the attachment model is a holographic sight (e.g., EOTech-style) rather than a magnified scope, so the in-game optic visual matches the physical model.
Can I use a negative Recoil_X or Recoil_Y value to completely eliminate recoil?
The fields accept float values including zero. Setting Recoil_X 0.0 eliminates horizontal recoil entirely. Setting Recoil_Y 0.0 eliminates vertical recoil. The cohort recommendation is to avoid these extremes for publicly released mods — zero-recoil configurations produce unfair gameplay advantages that hurt server reputation and mod longevity.
What happens if Hook_Sight is present but the gun .dat has no Sight field?
The hook exists in the prefab but is never used. The gun will not accept sight attachments at runtime because the Sight field is absent from the gun's .dat. The hook's presence in the prefab is harmless — it simply waits unused. To enable sight attachment support, add Sight 0 to the gun .dat (0 = no default sight).
Can a tactical attachment combine Light, Laser, and Rangefinder simultaneously?
Yes. All three flags can be present in the same tactical .dat. The result is an attachment that projects a flashlight cone, a visible laser, and displays a range readout in the HUD. This is a valid configuration for an advanced multi-function tactical unit.
Why does my suppressor equip but the gun is still audible at range?
The Silenced flag reduces the audio volume and switches the audio category to the suppressed variant, but it does not make the gun inaudible. Unturned's™ audio propagation model still transmits suppressed gunshot sounds at reduced range. If the goal is full audio removal, that requires a source-code modification outside the scope of standard modding.
Can I override ballistic drop per-sight for a sniper-class scope?
Yes. The Ballistic_Drop and Ballistic_Steps fields on a sight .dat override the gun's corresponding fields while that sight is equipped. A long-range scope can reduce Ballistic_Drop to 0.02 to model a flatter trajectory for players using the optic at range, making the sight functionally a ballistic upgrade as well as a visual one.
What is the smallest-footprint sight a player can carry?
There is no engine-enforced minimum inventory size. However, the cohort recommendation is to make sight items at least Size_X 1 and Size_Y 1 (one slot). Smaller than one slot is not supported. The largest practical sight is Size_X 3, Size_Y 1 for a long scope.
Does the Pro flag affect drop rates in vanilla loot tables?
The Pro flag makes the attachment eligible for the Pro variant drop pool, which is a separate loot tier from the normal loot table. Normal loot tables are unaffected by the Pro flag. The attachment will still appear in normal loot if configured in the map's spawn tables. Pro only adds it to an additional drop source.
Appendix A: Attachment slot .dat field summary
| Field | Sight | Grip | Tactical | Barrel |
|---|---|---|---|---|
ID | Required | Required | Required | Required |
GUID | Required | Required | Required | Required |
Type | Sight | Grip | Tactical | Barrel |
Slot | None | None | None | None |
Caliber | 0 or custom | 0 or custom | 0 or custom | 0 or custom |
Distance | Yes | — | — | — |
Zoom | Yes | — | — | — |
Holographic | Yes | — | — | — |
Night_Vision | Yes | — | — | — |
Spread_Multiplier_ADS | Yes | — | — | — |
Recoil_X | Yes | Yes | — | Yes |
Recoil_Y | Yes | Yes | — | Yes |
Spread | — | Yes | — | Yes |
Sway | — | Yes | — | — |
Light | — | — | Yes | — |
Laser | — | — | Yes | — |
Rangefinder | — | — | Yes | — |
Spotlight | — | — | Yes | — |
Silenced | — | — | — | Yes |
Volume | — | — | — | Yes |
Durability | — | — | — | Yes |
Braked | — | — | — | Yes |
Pro | Yes | Yes | Yes | Yes |
Appendix B: Hook GameObject naming reference
| Hook name | Slot it serves | Position on weapon |
|---|---|---|
Hook_Sight | Sight slot | Top of receiver rail |
Hook_Grip | Grip slot | Underside handguard rail |
Hook_Tactical | Tactical slot | Underside rail, mid-handguard |
Hook_Barrel | Barrel slot | Muzzle tip |
Hook_Magazine | Magazine (not an attachment slot) | Magazine well |
Case-sensitive naming
All hook names must be spelled and capitalized exactly as shown. The engine performs a case-sensitive string match. hook_Sight, HookSight, and Hook_sight will all fail to resolve at runtime.
Appendix C: Attachment authoring pre-bundle checklist
Complete this checklist before building the master bundle for any attachment mod. Catching errors at this stage avoids a full bundle rebuild cycle.
Attachment .dat file
- [ ]
IDis in the 50000+ range and does not conflict with vanilla or other loaded mods. - [ ]
GUIDis a valid 32-character hex string with no hyphens. - [ ]
Typematches the intended slot:Sight,Grip,Tactical, orBarrel. - [ ]
Slotis set toNone. - [ ]
Caliberis0(universal) or matches the target gun'sCaliberfield exactly. - [ ] All float fields use period (
.) as the decimal separator, not a comma. - [ ] No banned field names from deprecated API surface are used (confirm against https://docs.smartlydressedgames.com/en/stable/).
- [ ] Sight attachments:
Zoomis present and set to a value greater than or equal to1.0. - [ ] Barrel attachments:
Silencedflag is present if this is a suppressor; absent if it is not. - [ ] Barrel attachments:
Durabilityis present and set to a value less than1.0for degradable attachments.
Gun .dat file (if adding slot support to an existing gun)
- [ ] The correct slot field is present (
Sight,Grip,Tactical,Barrel). - [ ] The default attachment ID in the slot field is
0(no default) or a valid item ID that exists in the bundle. - [ ]
Caliberfield value matches the attachment'sCaliberfield if a non-zero caliber restriction is intended.
Unity prefab
- [ ]
Hook_Sightexists in the hierarchy (if Sight slot is enabled in.dat). - [ ]
Hook_Gripexists in the hierarchy (if Grip slot is enabled in.dat). - [ ]
Hook_Tacticalexists in the hierarchy (if Tactical slot is enabled in.dat). - [ ]
Hook_Barrelexists in the hierarchy (if Barrel slot is enabled in.dat). - [ ] All hook names use the exact casing shown: capital H, underscore, capital first letter of slot name.
- [ ] No two hooks share the same local position.
- [ ] All hooks have their forward (Z) axis aligned with the weapon bore direction.
- [ ] The attachment's own prefab is assigned to the asset bundle in Unity.
- [ ] The attachment prefab has a mesh renderer and the correct material assigned.
English.dat
- [ ]
Namefield is present and matches the display name intended for the inventory tooltip. - [ ]
Descriptionfield is present with the attachment's flavor or gameplay-information text.
Post-build
- [ ] Bundle
.unity3dfile is copied to the mod'sBundles/folder alongside the.datfiles. - [ ] Attachment equips correctly when tested in single-player with
@give <ID>. - [ ] Attachment sits at the correct visual position on the weapon with no clipping.
- [ ] All slot-specific behaviors are verified: zoom on sights, laser/light on tactical, silenced audio on suppressors, recoil reduction on grips.
Appendix D: Vanilla attachment caliber mapping
| Caliber value | Round family | Typical guns |
|---|---|---|
0 | Universal | All guns accept caliber-0 attachments |
1 | Pistol-class | Colt, Timberwolf, Ace |
2 | Rifle-class | Zubeknakov, Maplestrike, Nykorev |
3 | Precision-class | Timberwolf, Grizzly, CheyTac |
4 | Shotgun-class | Bluntforce, Snayperskya, double barrel |
5 | PDW-class | Honeybadger, Kraken |
These values are documented against the stable Unturned™ release. Confirm current values against the Smartly Dressed Games modding documentation before shipping a caliber-restricted attachment set.
Caliber values change between updates
Smartly Dressed Games occasionally adjusts vanilla caliber groupings during major updates. Before releasing a caliber-restricted attachment set, verify the target gun's current Caliber value in its vanilla .dat file inside the Unturned install directory at Bundles/Items/Guns/<weaponName>/. Do not rely solely on this table for caliber values; treat it as a starting reference.
Cross-references
- Gun Mod Tutorial — the prerequisite for building the weapon prefab with hook GameObjects
- Magazine Asset — the previous article; covers the
Caliber_Referencefield on magazines - Caliber Asset — the next article; covers how caliber linkage works between gun, magazine, and ammunition
- Master Bundle Export — the bundling step required after prefab edits
- Audio Packaging for Unturned — required for custom suppressed audio variants
- Smartly Dressed Games modding documentation — authoritative source for field names and enumeration values
- Unturned on Steam — the game this documentation targets
Document history
| Version | Date | Author | Notes |
|---|---|---|---|
| 1.0 | 2025-01-10 | 57 Studios | Initial publication. All four attachment slot types documented. |
| 1.1 | 2025-03-22 | 57 Studios | Added caliber compatibility flowchart and pro variant table. |
| 1.2 | 2025-05-18 | 57 Studios | Added diagnostic table, hook naming appendix, workflow flowchart. |
