The code you’re looking for is this.
void UAnimSequence::GetBonePose(FTransformArrayA2& OutAtoms, const FBoneContainer& RequiredBones, const FAnimExtractContext& ExtractionContext) const
This returns all transform of bone data in their parent space and there you can calculate exact bone you’d like. You also have to multiply ComponenToWorld to get worldspace since that will be still component space.
If you’re only wondering about root motion, you can use this function. That function also can be used to
FTransform UAnimSequence::ExtractRootMotion(float StartTime, float DeltaTime, bool bAllowLooping) const
>>In my game, I need to attach an actor to the bone of a skeletal mesh. Depending on the situations, the bone I attach the actor to is placed differently, depending on the section I wish to play in the montage.
Generally this isn’t the way we do. Since you never would like player to teleport, we give time to blend to the target location. We use target bone and while playing we makes player to interpolate to the target location.
Or you can use some prep animation that has correct bone transform to move to the location and when that’s done, you can transition to the animation that has to be in that position.