- Status
- Offline
- Joined
- Mar 3, 2026
- Messages
- 74
- Reaction score
- 7
Found some solid info on another board regarding the Tarkov crosshair issue. Since Tarkov maps the impact point to the barrel instead of the screen center, standard static overlays are basically trash. This breakdown explains how to pull the Fireport transform and calculate the world rotation to actually get a functional crosshair that accounts for the barrel offset.
The Logic:
You need to grab the PlayerBones class and locate the Fireport field (0x01C8). It uses a BifacialTransform, so you have to walk the chain to get to the native Unity Transform. Once you have the world position and the world rotation quaternion, you can rotate the local axis (negative Y for the barrel) to get the true world direction.
The math for the rotation:
It is a neat proof of concept. You could definitely layer in some smoothing or a raycast check for collisions if you wanted to get fancy with it, but the base math for the projection is here.
The Logic:
You need to grab the PlayerBones class and locate the Fireport field (0x01C8). It uses a BifacialTransform, so you have to walk the chain to get to the native Unity Transform. Once you have the world position and the world rotation quaternion, you can rotate the local axis (negative Y for the barrel) to get the true world direction.
Code:
[Class] PlayerBones : UnityEngine.MonoBehaviour
{
0x01C8 Fireport
0x01D0 LeftMultiBarrelFireport
0x01D8 RightMultiBarrelFireport
}
The math for the rotation:
Code:
// walk parent chain
while (parentIndex >= 0) {
parentRot = localRotation[parentIndex]
// result = parent * child
nx = pw*qx + px*qw + py*qz - pz*qy
ny = pw*qy - px*qz + py*qw + pz*qx
nz = pw*qz + px*qy - py*qx + pz*qw
nw = pw*qw - px*qx - py*qy - pz*qz
qx,qy,qz,qw = nx,ny,nz,nw
parentIndex = dependencyArray[parentIndex]
}
It is a neat proof of concept. You could definitely layer in some smoothing or a raycast check for collisions if you wanted to get fancy with it, but the base math for the projection is here.