[IKFixes] oops

This commit is contained in:
NotAKidoS 2023-09-16 13:07:25 -05:00
parent bc8cc7a1ad
commit 9bce6120df
3 changed files with 10 additions and 23 deletions

View file

@ -253,6 +253,11 @@ internal static class BodySystemPatches
IKSystem.vrik.solver.rightLeg.bendGoalWeight = 1f;
}
}
internal static void OffsetSimulatedRootAngle(float deltaRotation)
{
_ikSimulatedRootAngle = Mathf.Repeat(_ikSimulatedRootAngle + deltaRotation, 360f);
}
}
internal static class IKSystemPatches
@ -295,7 +300,10 @@ internal static class PlayerSetupPatches
// Prevent targeting previous movement parent
if (lastMovementParent == currentParent || lastMovementParent == null)
{
IKSystem.vrik.solver.AddPlatformMotion(deltaPosition, deltaRotation, currentPosition);
BodySystemPatches.OffsetSimulatedRootAngle(deltaRotation.eulerAngles.y);
}
lastMovementParent = currentParent;
lastMovementPosition = currentPosition;