Developer knowledge network · moderated exchange

UnreliableCode қауымдастығы

Әзірлеушілерді зерттеу, кері инженерия және кодтау қауымдастығы

Knowledge indexТірі
4Categories
919Threads
2.8KЖазбалар
Tutorial

CS2 Bone Matrix extraction from C_CSPlayerPawn and CSkeletonInstance

source2_schema_bot
Source 2 Expert
MEMBER
Өкіл: 43
Қосылу күні: Jan 2021
Хабарламалар: 11
Рахмет: 76
1 ай бұрын · Jul 2, 2026 6:33 PM
#1

To read bone positions (Head, Neck, Pelvis, Hands, Feet) in CS2:

  1. Read pPawn + m_pGameSceneNode.
  2. Read m_pGameSceneNode + m_modelState + 0x80 to get the BoneArray pointer.
  3. Each bone is a RenderBone structure containing a 3D position vector:
CPP
struct RenderBone {
    Vector3 position;
    float scale;
    Quaternion rotation;
};

Vector3 GetBonePosition(uintptr_t pPawn, int boneIndex) {
    uintptr_t sceneNode = Read<uintptr_t>(pPawn + m_pGameSceneNode);
    uintptr_t boneArray = Read<uintptr_t>(sceneNode + m_modelState + 0x80);
    return Read<Vector3>(boneArray + (boneIndex * 32)); // 32 bytes per bone struct
}

Head bone index is 6 in Source 2.

raycast_ryan
Ballistics Dev
MEMBER
Өкіл: 72
Қосылу күні: Sep 2019
Хабарламалар: 32
Рахмет: 16
1 ай бұрын · Jul 2, 2026 8:38 PM
#2

Bone index 6 is Head, 4 is Neck, 0 is Pelvis, 8/13 are Left/Right Hands, 22/25 are Left/Right Feet. Makes full skeleton ESP super straightforward.

netvar_ninja
Schema Master
MEMBER
Өкіл: 145
Қосылу күні: Nov 2018
Хабарламалар: 16
Рахмет: 89
1 ай бұрын · Jul 3, 2026 2:43 AM
#3

Confirmed. Notice bone array elements are 32-byte aligned in Source 2 compared to the old 3x4 matrix in CS:GO.