Updating Rapier Collider position based on Mixamo bone position

I’m a new indie game developer and learning how to attach hurt and hit boxes to models with Rapier colliders. I’m currently playing with the FBX Mixamo models, and my goal is to attach a CapsuleCollider to the model’s left hand, mixamorigLeftHand, that appears on normal attack (Q button). My thought process was to: (1) get the position of one of the hand bones, (2) attach a collider, and (3) update the collider’s position based on the bone’s position.

However, the bone’s position coordinates do not change even though I clearly see the skeleton moving with the animation. Check out the prototype at https://dg-proto.vercel.app/ and hold the Q button. The logs consistently show leftHandPos: 0, 0, 0 but I expected changing values over time.

Please, what am I misunderstanding? It feels like I’m missing something fundamental here, and I would appreciate some insight.

You can look at the React Three Fiber code at dg-proto/app/components/Character.tsx at 110909c61134feef70fe281e45aa1242b3f6c3ee · NyaliaLui/dg-proto · GitHub

Thank you

With some inspiration from the SkeletonHelper, I was able to get something working. The SkeletonHelper computes a buffer of all the vertices and draws a line from the parent’s vertex to the child. three.js/src/helpers/SkeletonHelper.js at a58e9ecf225b50e4a28a934442e854878bc2a959 · mrdoob/three.js · GitHub

We can take advantage of the vertices in the SkeletonHelper.geometry.attributes.position to estimate the location of a bone.

There are many bugs with this. For example, the collider slides farther away when the model is in motion and rotating, but at least there is a path forward!