SOLVED: The Skeleton instance's data doesn't change with animations. You have to use the Skeleton in the SkeletonAnimation. So change bounds.update(skeleton, true); to bounds.update(skeletonAnimation.skeleton, true); in the code below.
Original post
In Starling/AS3, my bounding boxes aren't following the animation. They instead stay stuck in the setup position. They follow the bones they're attached to in Spine just fine.
// in the setup
skeleton = new Skeleton(skeletonData);
bounds = new SkeletonBounds();
skeletonAnimation = new SkeletonAnimation(skeletonData, true);
skeletonAnimation.state.setAnimationByName(0, "animation", true);
addChild(skeletonAnimation);
Starling.juggler.add(skeletonAnimation);
...
// in the click event
bounds.update(skeleton, true);
trace(bounds.containsPoint(localPos.x, localPos.y));
I also tried stuffing updateWorldTransform() wherever I could, but it made no difference.
Stepping through the SkeletonBounds update() function, and the BoundingBoxAttachment computeWorldVertices() function showed that the exact same data is being passed in each time. The values on the Bone and the BoundingBoxAttachment's vertices are always the same. Surely something in there should be changing to reflect the bone's rotation and position during the animation?
Am I missing something incredibly silly?
Thanks in advance for any help!