Skip to content

Properly implement the real Deagle + AWP viewmodels with the arms - #40

Merged
yassinsolim merged 1 commit into
mainfrom
feat/real-deagle-awp-viewmodels-with-arms
Jul 3, 2026
Merged

Properly implement the real Deagle + AWP viewmodels with the arms#40
yassinsolim merged 1 commit into
mainfrom
feat/real-deagle-awp-viewmodels-with-arms

Conversation

@yassinsolim

Copy link
Copy Markdown
Owner

What & why

A fresh, from-scratch pass at both gun viewmodels using the real downloaded Sketchfab models, done properly like the knife — plus a keybind fix so you can actually reload.

The breakthrough

Both models ship a broken skinned export where the gun meshes are authored thousands of units from the hands. Crucially, I verified this with SkinnedMesh.applyBoneTransform (the only reliable way — computeBoundingBox and headless bounds both lie about skinned meshes, which is what misled the earlier attempts). Ground truth: the Deagle's arms skin perfectly to the origin and its Weapon bone tracks the hand.

Deagle — real arms holding a real gun ✅

Keep the real animated arms (detailed tactical gloves + watch, posed gripping) and rigidly bolt the extracted gun (MainBody/Slide/Magazine) to the Weapon bone, which the arm animation carries. Result: real hands holding a real Deagle, right-way-up, through equip/idle/fire/reload. No more upside-down gun-only.

AWP — the hard one

Its arms skin to a different place than the gun and are low-poly, so a hands-on-rifle view genuinely isn't achievable from this model. So I hide the arms and present the gun fit by its bind-space geometry — a clean, correctly-oriented rifle (scope/receiver/stock/barrel), fixing the "facing up / wrong side / blocky" look. One mesh that skins away is dropped.

Honest note: the AWP model's own arms are both broken (disconnected from the gun in the skinned render) and low-poly, so the AWP is a clean gun-only rifle while the Deagle carries the full arms+gun showcase. If you want arms on the AWP too, the cleanest path is grafting the Deagle's nice glove-arms onto the AWP gun — happy to do that as a follow-up.

Reload keybind fix ✅

R was bound to both reset-to-spawn and reload, so it teleported you instead of reloading. R now reloads in combat; reset-to-spawn is kept for non-combat surf practice only.

Implementation

WeaponViewmodels is rewritten around this: load the whole model, optional gun-attach to a bone, hide broken/aim-helper meshes, fit by skinned bounds (Deagle) or bind-geometry bounds (AWP), and play the authored equip/idle/fire/reload clips. Brighter viewmodel lighting carried over so the dark gun textures read against the map.

  • AWP ships as the raw 6 MB GLB (files as they came).
  • Deagle reuses the faithful 13 MB build — I re-verified its arms skin identically to the 221 MB raw.

Verification

  • Tuned + confirmed both viewmodels through the real ViewmodelRenderer (same FOV/lights/camera-mount as in-game) — Deagle shows arms gripping the gun; AWP shows a clean rifle.
  • npm run ci green: typecheck + 138 tests + build.
  • In-game gameplay capture is blocked by pointer-lock under automation, so please give it a spin — switch to 2 (Deagle) / 3 (AWP) and hit R to reload.

Fresh, from-scratch approach to both gun viewmodels using the real
downloaded Sketchfab models, plus a keybind fix so you can actually
reload.

The breakthrough: both models ship a broken skinned export where the gun
meshes are authored thousands of units from the hands — but I verified
(via SkinnedMesh.applyBoneTransform, the only reliable way; computeBounds
and headless bounds both lie about skinned meshes) that the Deagle's ARMS
skin perfectly to the origin and its Weapon bone tracks the hand. So:

- Deagle: keep the real animated arms (detailed tactical gloves + watch,
  posed gripping) and rigidly bolt the extracted gun (MainBody/Slide/
  Magazine) to the Weapon bone, which the arm animation carries. Result:
  real hands holding a real Deagle, right-way-up, through equip/idle/fire/
  reload. No more upside-down gun-only.

- AWP (the hard one): its arms skin to a different place than the gun and
  are low-poly, so a hands-on-rifle view isn't achievable from this model.
  Hide the arms and present the gun fit by its bind-space geometry — a
  clean, correctly-oriented rifle (scope/receiver/stock/barrel), fixing the
  'facing up / wrong side / blocky' look. Drop the one mesh that skins away.

WeaponViewmodels is rewritten around this: load whole model, optional
gun-attach to a bone, hide broken/aim helper meshes, fit by skinned bounds
(Deagle) or bind-geometry bounds (AWP), play the authored clips. Brighter
viewmodel lighting carried over so the dark gun textures read on the map.

Keybind: R was bound to BOTH reset-to-spawn and reload, so it teleported
you instead of reloading. R now reloads in combat; reset-to-spawn is kept
for non-combat surf practice only.

AWP ships as the raw 6MB GLB; the Deagle reuses the faithful 13MB build
(its arms are intact — verified). CI green (138 tests).
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webstrafe Ready Ready Preview, Comment Jul 3, 2026 3:36am

@yassinsolim
yassinsolim merged commit b0dcfd9 into main Jul 3, 2026
3 checks passed
@yassinsolim
yassinsolim deleted the feat/real-deagle-awp-viewmodels-with-arms branch July 3, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant