Hi everyone! I am trying to do procedural ADS animations on my character from the First Person view. I am following this video from here: https://www.youtube.com/watch?v=Y2oKnX6PtFw with a difference that I am using UE5 manny full mesh and C++ code to calculate AimPoint and AimSocket transforms. But it is close enough that I can comparatively follow the example.
Relevant code is:
const FTransform FPVCameraTransform = OwningCharacter->GetCamera()->GetComponentTransform();
const FTransform IKHandRootTransform = OwningCharacterMesh->GetSocketTransform(FName("ik_hand_root"), RTS_World);
FTransform AimRelativeTransform = FPVCameraTransform.GetRelativeTransform(IKHandRootTransform);
AimPointLocation = AimRelativeTransform.GetLocation() + AimRelativeTransform.GetRotation().GetForwardVector() * 20.f;
AimPointRotation = AimRelativeTransform.GetRotation().Rotator();
const FTransform WeaponAimSocketTransform = Weapon->GetMesh()->GetSocketTransform(FName("AimSocket"), RTS_World);
WeaponAimSocketRelativeTransform = WeaponAimSocketTransform.GetRelativeTransform(IKHandRootTransform);
AimSocketLocation = WeaponAimSocketRelativeTransform.GetLocation();
AimSocketRotation = WeaponAimSocketRelativeTransform.GetRotation().Rotator();
When I draw debug spheres and debug arrows at AimPointLocation and AimPointRotation they show up corerctly where they should be in the middle of the screen where my crosshairs are and are pointed in the direction where I am looking. Likewise AimSocketLocation and AimSocketRotation are where they should be at the weapon’s AimSocket and pointing in the direction where weapon’s muzzle is pointed to.
Then I use the nodes (pretty much same as in the video):
It seems to work all the way up to those two “Two Bone IK” nodes. ik_hand_gun is moved first to weapon’s AimSocket, ik_hand_r and ik_hand_l moved to the hand_r and hand_l respectively and Transform (Modify) Bone moves ik_hand_gun to the AimPoint where it should be pulling ik_hand_r and ih_hand_l where hands should be. But when I connect those last two nodes (Two Bone IK) I get this:
I don’t know why my character decided to rave like he’s the Techno Viking and can’t figure out. Tried everything I could remember and chances are it might be some stupid bug but thought I might ask here if anyone has any idea / suggestion what to try? It feels like it’s something related to the Effector but I tried changing options and still didn’t work.