Help! Fixing Incorrect Skeleton ESP Bone Mapping in IL2CPP Game

pewdiftw

Platinian
I'm working on an external ESP (Unity IL2CPP, x86_64).

My skeleton ESP has incorrect bone positions and misaligned connections. Some joints appear misplaced instead of following the character's actual animations.

What's the best way to retrieve and map the correct native humanoid bone transforms from an IL2CPP Unity game?

I've already got the <span>dump.cs</span> and basic skeleton rendering working. Looking for advice on accurate bone hierarchy discovery and transform mapping.

Thanks!
Screenshot 2026-11-08 085534.png
Screenshot 2026-11-08 011128.png
Screenshot 2026-11-08 091828.png
 
You have two separate bugs and only one of them is about bones. The misaligned joints are a resolution problem. The scope flicker is a camera problem. Fixing them in that order matters, because the flicker will mask whether the mapping actually got better.

Why your bone mapping is wrong
The most common cause is indexing bones. SkinnedMeshRenderer.bones is in vertex-binding order, not hierarchy order, and it differs per mesh. If you built a fixed index table, joints will land on the wrong limbs and the segments you draw between them will not be parent-child pairs - which is exactly the "misplaced joints with wrong connections" look in your first screenshot.

Do it in this order instead:

  1. Resolve by name or by humanoid enum, never by index. Unity already exposes the mapping: Animator.GetBoneTransform(HumanBodyBones). Call it with enum values read from HumanBodyBones in your dump - it is a stable engine enum, Hips is 0 and Head is 10, and the values do not shift between builds. If a game strips humanoid, fall back to walking the transform hierarchy and matching name against avatar.humanDescription.human[].boneName.
  2. Cache the resolved transforms, not the resolved positions. Re-read position per frame from the cached pointer. Cache positions and you get frozen joints that jump when the animator rebuilds.
  3. Invalidate the cache on rig rebuild. Death, respawn, LOD swap and weapon switch all destroy transforms. Key your cache on the animator instance and drop it when that instance changes. Stale pointers are the second most common cause of this exact symptom.
  4. Draw connections from the hierarchy, parent to child, walking up from each bone. Never from a hardcoded pair list. If a line does not connect a real parent and child, it is a guess.
  5. Use world position. Transform.get_position(), or compose the matrix chain if you read raw memory. Local position without the parent chain gives you a skeleton that sits offset from the body and rotates wrongly, which is another way to get the same picture.
  6. Apply the root lossyScale. A scaled character scales every local offset. If your skeleton is roughly correct but proportionally too large or small, that is this.

Pick the right rig
Most shooters have several rigs on one player: first-person arms, a third-person body, and ragdoll copies. Draw the one whose Animator.isHuman is true on the player root, and draw nothing else. Doubled and offset skeletons usually mean you are sampling two different rigs in the same frame.

Gate on your own sanity counter
Your HUD already prints skel:17/18 (inv=1) and later 18/18 (inv=0), so you have the number - use it. Suppress the whole skeleton unless the resolved count equals the expected count. One missing bone currently draws a line to whatever happens to be at index 17, and that is worse than drawing nothing. Same for segment length: drop a segment if it deviates more than about 30% from the reference proportion for that pair.

The scope flicker
This is not the skeleton, and you can prove it: it only appears when you scope, so it is camera state.

  • FOV. Scoping changes camera FOV hard, often to 20 or less. If your world-to-screen uses a cached or hardcoded FOV and aspect, every projection drifts the moment you scope and snaps back when you unscope. Read FOV live, every frame, from the camera.
  • Camera swap. Scopes commonly switch to a separate camera or a render-texture overlay. Your cached camera pointer is then one frame stale and produces a garbage matrix. Re-resolve the camera each frame and validate it - FOV inside a sane range, matrix not identity, near plane not zero.
  • Use the engine's matrices. worldToCameraMatrix * projectionMatrix instead of rebuilding them. Rebuilding is where FOV and aspect bugs live.
  • Behind-camera points. A point with negative w projects to huge coordinates and draws a line across the screen for one frame. Reject any point with w <= 0 before projecting.
  • Buffer the frame. Build all geometry into a buffer, then blit once. Drawing while you are still reading the game's state is what produces the shimmer.

x86_64 specifics
You are on an emulator, so two things to check before anything else: pointers are 8 bytes, and any struct offsets you lifted from an arm64 dump will be wrong on x86_64 because IL2CPP lays out differently per ABI. Confirm you dumped the x86_64 lib, not the arm64 one.

Summary of what to do
  1. Confirm you are on the x86_64 lib and dump.
  2. Replace the index table with GetBoneTransform or name matching.
  3. Cache transforms, re-read positions, invalidate on respawn.
  4. Draw only parent-child pairs from the hierarchy, only the humanoid rig.
  5. Gate rendering on full bone count and sane segment lengths.
  6. Then, and only then, fix the camera: live FOV, per-frame camera resolve, w > 0 rejection, single blit.

One last thing worth doing early: log the bone names next to the indices you resolve. If a joint is misplaced and the log says 17 = RightFoot where you expected Head, you will see the ordering problem in one match instead of guessing at it for a week.
 
You have two separate bugs and only one of them is about bones. The misaligned joints are a resolution problem. The scope flicker is a camera problem. Fixing them in that order matters, because the flicker will mask whether the mapping actually got better.

Why your bone mapping is wrong
The most common cause is indexing bones. SkinnedMeshRenderer.bones is in vertex-binding order, not hierarchy order, and it differs per mesh. If you built a fixed index table, joints will land on the wrong limbs and the segments you draw between them will not be parent-child pairs - which is exactly the "misplaced joints with wrong connections" look in your first screenshot.

Do it in this order instead:

  1. Resolve by name or by humanoid enum, never by index. Unity already exposes the mapping: Animator.GetBoneTransform(HumanBodyBones). Call it with enum values read from HumanBodyBones in your dump - it is a stable engine enum, Hips is 0 and Head is 10, and the values do not shift between builds. If a game strips humanoid, fall back to walking the transform hierarchy and matching name against avatar.humanDescription.human[].boneName.
  2. Cache the resolved transforms, not the resolved positions. Re-read position per frame from the cached pointer. Cache positions and you get frozen joints that jump when the animator rebuilds.
  3. Invalidate the cache on rig rebuild. Death, respawn, LOD swap and weapon switch all destroy transforms. Key your cache on the animator instance and drop it when that instance changes. Stale pointers are the second most common cause of this exact symptom.
  4. Draw connections from the hierarchy, parent to child, walking up from each bone. Never from a hardcoded pair list. If a line does not connect a real parent and child, it is a guess.
  5. Use world position. Transform.get_position(), or compose the matrix chain if you read raw memory. Local position without the parent chain gives you a skeleton that sits offset from the body and rotates wrongly, which is another way to get the same picture.
  6. Apply the root lossyScale. A scaled character scales every local offset. If your skeleton is roughly correct but proportionally too large or small, that is this.

Pick the right rig
Most shooters have several rigs on one player: first-person arms, a third-person body, and ragdoll copies. Draw the one whose Animator.isHuman is true on the player root, and draw nothing else. Doubled and offset skeletons usually mean you are sampling two different rigs in the same frame.

Gate on your own sanity counter
Your HUD already prints skel:17/18 (inv=1) and later 18/18 (inv=0), so you have the number - use it. Suppress the whole skeleton unless the resolved count equals the expected count. One missing bone currently draws a line to whatever happens to be at index 17, and that is worse than drawing nothing. Same for segment length: drop a segment if it deviates more than about 30% from the reference proportion for that pair.

The scope flicker
This is not the skeleton, and you can prove it: it only appears when you scope, so it is camera state.

  • FOV. Scoping changes camera FOV hard, often to 20 or less. If your world-to-screen uses a cached or hardcoded FOV and aspect, every projection drifts the moment you scope and snaps back when you unscope. Read FOV live, every frame, from the camera.
  • Camera swap. Scopes commonly switch to a separate camera or a render-texture overlay. Your cached camera pointer is then one frame stale and produces a garbage matrix. Re-resolve the camera each frame and validate it - FOV inside a sane range, matrix not identity, near plane not zero.
  • Use the engine's matrices. worldToCameraMatrix * projectionMatrix instead of rebuilding them. Rebuilding is where FOV and aspect bugs live.
  • Behind-camera points. A point with negative w projects to huge coordinates and draws a line across the screen for one frame. Reject any point with w <= 0 before projecting.
  • Buffer the frame. Build all geometry into a buffer, then blit once. Drawing while you are still reading the game's state is what produces the shimmer.

x86_64 specifics
You are on an emulator, so two things to check before anything else: pointers are 8 bytes, and any struct offsets you lifted from an arm64 dump will be wrong on x86_64 because IL2CPP lays out differently per ABI. Confirm you dumped the x86_64 lib, not the arm64 one.

Summary of what to do
  1. Confirm you are on the x86_64 lib and dump.
  2. Replace the index table with GetBoneTransform or name matching.
  3. Cache transforms, re-read positions, invalidate on respawn.
  4. Draw only parent-child pairs from the hierarchy, only the humanoid rig.
  5. Gate rendering on full bone count and sane segment lengths.
  6. Then, and only then, fix the camera: live FOV, per-frame camera resolve, w > 0 rejection, single blit.

One last thing worth doing early: log the bone names next to the indices you resolve. If a joint is misplaced and the log says 17 = RightFoot where you expected Head, you will see the ordering problem in one match instead of guessing at it for a week.
im using a x86_64 dump and i just want make iexternal visibility check is it possible cuz i ve been trying to this for weeks
Screenshot (884).png
 
im using a x86_64 dump and i just want make iexternal visibility check is it possible cuz i ve been trying to this for weeksView attachment 1056083

Short answer: yes, but not by computing it yourself. Read the game's own answer first.
Three weeks on this suggests you are on the obvious field and it is silently failing. It will, because neither obvious option does what the name promises:

  • Renderer.isVisible - frustum only, no occlusion, and true if any camera sees the renderer. Shadow casters and reflection probes keep it permanently true.
  • OnBecameVisible - only fires if that specific script implements the callback, and fires for the same extra cameras.

The flag exists, it is just the wrong flag. Same discipline as the skel:17/18 gate from my last post: suppress rather than draw something wrong.

1. Check whether the game already hides occluded models
Games in this lineage disable renderers and swap to billboard or low-LOD proxies behind geometry. If it does, the answer is already in memory and costs one read.

Test in 60 seconds: wall between you and a bot, then watch enabled on the SkinnedMeshRenderer and GameObject.activeSelf on the model root. Flips to 0 behind cover and back to 1 in the open, and you are done - skip the rest.

No flip? Look at the network side. This lineage culls by network group, so there is an in-scope flag the server drives. That one is usually range-based, not wall-based - confirm against real cover before trusting it.

2. Otherwise ray it yourself, with the filters
Physics.Raycast is not callable externally, so you reimplement ray against bounds. A naive version reports everything blocked because it hits the target's own hitboxes and every trigger volume in the world:

  • Drop the target's own colliders - walk each collider's transform up to the target root, skip on match, and skip your local player too.
  • Drop triggers - read Collider.isTrigger. Water, foliage, pickups and zone volumes all fake a block.
  • Drop non-blocking layers - read GameObject.layer and build the allowlist from layers that actually stop bullets.
  • Shrink bounds - bounds is axis-aligned and fatter than the mesh, so thin walls read clear. Scale about 0.85.

Ray from camera origin to three points - head, chest, pelvis - and pass on two of three. One of three is what is giving you corner false positives now.

Code:
bool blocked = false;
for (auto& c : worldColliders) {
    if (c.owner == target || c.isTrigger || !allowed(c.layer)) continue;
    AABB b = c.bounds; b.shrink(0.85f);
    if (rayAABB(camPos, dirTo(sample), b, maxDist)) { blocked = true; break; }
}

Sort by distance, break on first hit. At 82m you cross dozens of colliders per ray and the early-out is most of the budget.

3. Budget against your own overlay numbers
You are already printing 82m and 74m. Do not raycast that every frame. Cap at 60m, project first and discard anything off-screen before raycasting, test every 4th to 8th frame per target staggered so the work spreads, and cache the boolean with a timestamp.

4. Hold the result or it will strobe
Strafing past a corner flips the test every frame and the box recolours 20 times a second - worse than no check. Require N consecutive clear to go visible and M consecutive blocked to go occluded, M larger than N. Two and four is a start. Same principle as the scope flicker: hold state, do not chase the instantaneous value.

5. Why not depth
Pixel-true and it would solve this outright, but the depth attachment is not exposed to an external process on Android - you need a GL hook in the render thread, which makes it internal. Later, not first.

One ABI note before you start: every bounds and Collider offset is x86_64-layout, so if any of them came from the arm64 dump your ray starts from garbage and looks like a logic bug.

TL;DR
isVisible is frustum-only and poisoned by shadow cameras. Check first whether the model renderer disables behind cover and read that. If not, ray-AABB with self/trigger/layer filtering, shrunk bounds, three samples, two-of-three, 60m cap, staggered, hysteresis on output. Depth only after that works.
 
Short answer: yes, but not by computing it yourself. Read the game's own answer first.
Three weeks on this suggests you are on the obvious field and it is silently failing. It will, because neither obvious option does what the name promises:

  • Renderer.isVisible - frustum only, no occlusion, and true if any camera sees the renderer. Shadow casters and reflection probes keep it permanently true.
  • OnBecameVisible - only fires if that specific script implements the callback, and fires for the same extra cameras.

The flag exists, it is just the wrong flag. Same discipline as the skel:17/18 gate from my last post: suppress rather than draw something wrong.

1. Check whether the game already hides occluded models
Games in this lineage disable renderers and swap to billboard or low-LOD proxies behind geometry. If it does, the answer is already in memory and costs one read.

Test in 60 seconds: wall between you and a bot, then watch enabled on the SkinnedMeshRenderer and GameObject.activeSelf on the model root. Flips to 0 behind cover and back to 1 in the open, and you are done - skip the rest.

No flip? Look at the network side. This lineage culls by network group, so there is an in-scope flag the server drives. That one is usually range-based, not wall-based - confirm against real cover before trusting it.

2. Otherwise ray it yourself, with the filters
Physics.Raycast is not callable externally, so you reimplement ray against bounds. A naive version reports everything blocked because it hits the target's own hitboxes and every trigger volume in the world:

  • Drop the target's own colliders - walk each collider's transform up to the target root, skip on match, and skip your local player too.
  • Drop triggers - read Collider.isTrigger. Water, foliage, pickups and zone volumes all fake a block.
  • Drop non-blocking layers - read GameObject.layer and build the allowlist from layers that actually stop bullets.
  • Shrink bounds - bounds is axis-aligned and fatter than the mesh, so thin walls read clear. Scale about 0.85.

Ray from camera origin to three points - head, chest, pelvis - and pass on two of three. One of three is what is giving you corner false positives now.

Code:
bool blocked = false;
for (auto& c : worldColliders) {
    if (c.owner == target || c.isTrigger || !allowed(c.layer)) continue;
    AABB b = c.bounds; b.shrink(0.85f);
    if (rayAABB(camPos, dirTo(sample), b, maxDist)) { blocked = true; break; }
}

Sort by distance, break on first hit. At 82m you cross dozens of colliders per ray and the early-out is most of the budget.

3. Budget against your own overlay numbers
You are already printing 82m and 74m. Do not raycast that every frame. Cap at 60m, project first and discard anything off-screen before raycasting, test every 4th to 8th frame per target staggered so the work spreads, and cache the boolean with a timestamp.

4. Hold the result or it will strobe
Strafing past a corner flips the test every frame and the box recolours 20 times a second - worse than no check. Require N consecutive clear to go visible and M consecutive blocked to go occluded, M larger than N. Two and four is a start. Same principle as the scope flicker: hold state, do not chase the instantaneous value.

5. Why not depth
Pixel-true and it would solve this outright, but the depth attachment is not exposed to an external process on Android - you need a GL hook in the render thread, which makes it internal. Later, not first.

One ABI note before you start: every bounds and Collider offset is x86_64-layout, so if any of them came from the arm64 dump your ray starts from garbage and looks like a logic bug.

TL;DR
isVisible is frustum-only and poisoned by shadow cameras. Check first whether the model renderer disables behind cover and read that. If not, ray-AABB with self/trigger/layer filtering, shrunk bounds, three samples, two-of-three, 60m cap, staggered, hysteresis on output. Depth only after that works.
ill let you know if the problem is resolved
 
Not using isVisible, not calling colliders — neither is reachable externally anyway. Mine's the PhysX-style route: world snapshot of OBBs, plain ray-vs-box on the render thread. No culling flags, no shadow cameras, no collider soup.
Two bits of your post were legit though, and I've just shipped both:
  • Hysteresis — you're right, strafing a corner was strobing the box. Now held: 2 clear to go green, 4 blocked to go red.
  • 2-of-3 samples — was chest-only, which is why corners read red. Now chest first, then head + pelvis if it's blocked, 2 of 3 clear = visible.
Not doing the 0.85 bounds shrink — my boxes are exact OBBs, not fat AABBs, shrinking just opens thin walls. Layer/trigger filters are moot, nothing but blocking world geometry is in the snapshot. Renderer.enabled behind cover is worth a test, but not before I'm sure the geometry's clean.
Depth I agree on — external process can't see it, that's a hook, different project.
ABI note doesn't apply: emulator's x86_64, offsets are x86_64.
TL;DR you assumed the obvious field, I'm not on it. The strobing and corner reds were real though. Fixed.
 
Not using isVisible, not calling colliders — neither is reachable externally anyway. Mine's the PhysX-style route: world snapshot of OBBs, plain ray-vs-box on the render thread. No culling flags, no shadow cameras, no collider soup.
Two bits of your post were legit though, and I've just shipped both:
  • Hysteresis — you're right, strafing a corner was strobing the box. Now held: 2 clear to go green, 4 blocked to go red.
  • 2-of-3 samples — was chest-only, which is why corners read red. Now chest first, then head + pelvis if it's blocked, 2 of 3 clear = visible.
Not doing the 0.85 bounds shrink — my boxes are exact OBBs, not fat AABBs, shrinking just opens thin walls. Layer/trigger filters are moot, nothing but blocking world geometry is in the snapshot. Renderer.enabled behind cover is worth a test, but not before I'm sure the geometry's clean.
Depth I agree on — external process can't see it, that's a hook, different project.
ABI note doesn't apply: emulator's x86_64, offsets are x86_64.
TL;DR you assumed the obvious field, I'm not on it. The strobing and corner reds were real though. Fixed.
Fair on all four. Conceded, and here is what your setup introduces instead.
isVisible - yes, I aimed at the field a reader would reach for, not at what you had. Colliders - half right and worth one line: Physics.Raycast is not callable externally, but bounds, isTrigger and layer are readable off the managed object, so the filters are not dead, just irrelevant while the snapshot is geometry-only. 0.85 shrink - agreed, that is an AABB compensation and it is wrong for exact OBBs. ABI - agreed, x86_64 to x86_64.

1. First thing to check: are you comparing t at all
A ray that hits a box behind the target still reports blocked. If the test is "first hit exists", everything with geometry behind it reads red, and the further out the target the worse it gets - your 82m entries would be permanently red through open sky if a hill is 200m back. The comparison is:

Code:
blocked = (t_hit < t_target - 0.05f);

Measure t_target to the same sample point you are testing, not to the root, or chest and root disagree and you get a systematic offset at range.

2. Ray origin inside a box
Pressed against a wall or scoped flush to cover, the camera origin sits inside geometry and a slab test returns t=0. Depending on how you branch that, you get either permanent red or green through the wall. Treat "origin inside box" as non-blocking and start the ray at the near plane - being inside a wall does mean you can see out of it.

3. Snapshot coherence
This is the one that will bite in a build game. Players build walls. A timer-rebuilt snapshot has a window where a fresh wall does not exist and you read green straight through it. Rebuild on spawn/despawn deltas rather than on a clock, and swap buffers - never mutate the live one.

If the rebuild is on a worker and the test is on the render thread, double-buffer with an atomic generation counter and publish only after the swap, or you iterate a half-updated set and ray against boxes that moved out from under you.

4. Broadphase, because OBB is not AABB
Slab against an OBB means transforming the ray into box space first, so it is roughly double an AABB test, and your snapshot is dense. At 82m, sorting by t and breaking early still means touching every box closer than the target. Bucket the snapshot into a grid and walk cells along the ray - you only ever test what the ray actually crosses. Cheap to add, and it is the difference between holding frame rate at 8 targets and 30.

5. Hysteresis: freeze, do not decay
2/4 is the right asymmetry. Add one rule though - when a target stops being sampled, off-screen or past the cap, hold its last state instead of letting it tick toward red. Otherwise the counter runs down while it is out of view and it pops green on re-entry from a read that is seconds stale.

6. When you do test enabled
Right call deferring it. When you get there: the model root carries several renderers - skin, weapon, attachments, nameplate - and enabled on the skinned mesh also flips for attachment swap and LOD, not only occlusion. Use it as a cross-check against the OBB result, never as the driver, or you will chase desyncs that are not occlusion at all.

TL;DR - t_hit < t_target or nothing behind the target matters. Origin-inside means not blocked. Rebuild on deltas, double-buffer, publish after swap. Grid broadphase. Freeze hysteresis when unsampled. enabled is a cross-check only.
 
Fair on all four. Conceded, and here is what your setup introduces instead.
isVisible - yes, I aimed at the field a reader would reach for, not at what you had. Colliders - half right and worth one line: Physics.Raycast is not callable externally, but bounds, isTrigger and layer are readable off the managed object, so the filters are not dead, just irrelevant while the snapshot is geometry-only. 0.85 shrink - agreed, that is an AABB compensation and it is wrong for exact OBBs. ABI - agreed, x86_64 to x86_64.

1. First thing to check: are you comparing t at all
A ray that hits a box behind the target still reports blocked. If the test is "first hit exists", everything with geometry behind it reads red, and the further out the target the worse it gets - your 82m entries would be permanently red through open sky if a hill is 200m back. The comparison is:

Code:
blocked = (t_hit < t_target - 0.05f);

Measure t_target to the same sample point you are testing, not to the root, or chest and root disagree and you get a systematic offset at range.

2. Ray origin inside a box
Pressed against a wall or scoped flush to cover, the camera origin sits inside geometry and a slab test returns t=0. Depending on how you branch that, you get either permanent red or green through the wall. Treat "origin inside box" as non-blocking and start the ray at the near plane - being inside a wall does mean you can see out of it.

3. Snapshot coherence
This is the one that will bite in a build game. Players build walls. A timer-rebuilt snapshot has a window where a fresh wall does not exist and you read green straight through it. Rebuild on spawn/despawn deltas rather than on a clock, and swap buffers - never mutate the live one.

If the rebuild is on a worker and the test is on the render thread, double-buffer with an atomic generation counter and publish only after the swap, or you iterate a half-updated set and ray against boxes that moved out from under you.

4. Broadphase, because OBB is not AABB
Slab against an OBB means transforming the ray into box space first, so it is roughly double an AABB test, and your snapshot is dense. At 82m, sorting by t and breaking early still means touching every box closer than the target. Bucket the snapshot into a grid and walk cells along the ray - you only ever test what the ray actually crosses. Cheap to add, and it is the difference between holding frame rate at 8 targets and 30.

5. Hysteresis: freeze, do not decay
2/4 is the right asymmetry. Add one rule though - when a target stops being sampled, off-screen or past the cap, hold its last state instead of letting it tick toward red. Otherwise the counter runs down while it is out of view and it pops green on re-entry from a read that is seconds stale.

6. When you do test enabled
Right call deferring it. When you get there: the model root carries several renderers - skin, weapon, attachments, nameplate - and enabled on the skinned mesh also flips for attachment swap and LOD, not only occlusion. Use it as a cross-check against the OBB result, never as the driver, or you will chase desyncs that are not occlusion at all.

TL;DR - t_hit < t_target or nothing behind the target matters. Origin-inside means not blocked. Rebuild on deltas, double-buffer, publish after swap. Grid broadphase. Freeze hysteresis when unsampled. enabled is a cross-check only.
bro are u using ai to respond ?lmao if yes i will ask ai tbh
 
Back
Top Bottom