Getting Bone Location after Mirroring Player

We are using the Mirroring Animation feature to easily mirror our player’s animations and poses. An issue that we are running into is that when we try to grab the location of a bone after we mirror our player, we expect to get the location of the mirror counterpart.

For example, let’s say we are trying to get the bone location of a bone called r_hand_JNT when the player is mirrored. The mirror counterpart of r_hand_JNT is l_hand_JNT. When we attempt to get the location of the r_hand_JNT while mirrored, we still get the original location of r_hand_JNT as if the bone wasn’t mirrored, but we are expecting the location of l_hand_JNT.

Is this intended behavior or is there a way to easily get the mirrored bone location when we mirror our player?

Steps to Reproduce

  1. Mirror the character using the Mirroring Animation feature.
  2. Get a bone location that has a mirror counterpart (e.g. l_hand_JNT and r_hand_JNT) using a function such as USkinnedMeshComponent::GetBoneLocation(FName BoneName, EBoneSpaces::Type Space).
  3. Observe that the location of the bone grabbed by the function isn’t mirrored. For example, getting the bone location of r_hand_JNT after mirroring the character will still give you the location of r_hand_JNT as if the character was not mirrored. We were expecting to get the location of l_hand_JNT when we mirrored the character and got the bone location of r_hand_JNT.

Hey there,

Using a runtime mirrored animation, I did a local test with both GetSocketLocation and GetBoneLocation, and was able to repro the issue. Would you be able to send any repro’s or more info in terms of your setup?

Dustin

Hey Dustin,

The setup is basically as simple as mentioned. We did figured out that if we used GetSocketLocation or GetBoneLocation and did whatever logic we needed before we actually mirrored the pose, then mirroring the pose worked out.

Our mistake was performing logic on GetSocketLocation or GetBoneLocation after we mirrored the posed.