Hello,

I have a project whose player character is a 3D KinematicBody containing a Skeleton for the armature, and a MeshInstance for the model.

There is a ledge-hanging mechanic, which places the character's origin between its hands, on the ledge, with its body suspended underneath:

When the character lets go, I'd like to retrieve the mesh's exact size on the vertical axis, in order to find the position of its feet, and see how far they are from the ground below.

Is it possible to retrieve a mesh's axis-aligned bounding box, when it's deformed by an animation?

The MeshInstance class does have a get_aabb() method, but it only returns the static bounding box of the model in the T-pose.

Thank you.

I’m not sure if there is a way to get the animated AABB, but you may be able to use a BoneAttachment node and assign it to the foot, and then get the position of the BoneAttachment node to get the position of the feet.

Thank you. I had considered doing something with individual bones; it would probably be accurate enough for this case, but I had hoped there would be a simple way to get an animated bounding box for broader use.

Still, a BoneAttachment is perfect for getting the exact coordinates of the feet. I'll have to see if it's easier than just inverting the offset and keeping the character's origin point at its feet, since the ledge-climbing animation will use a known, specific displacement, unlike the falling and landing animations which can involve a fall from any height.

2 years later