VRCMods icon indicating copy to clipboard operation
VRCMods copied to clipboard

[IKtweaks] legs bend when i look down

Open Friskyweed opened this issue 4 years ago • 2 comments

like the title says, my legs will bend when I look down and I don't know what I need to change to fix this so any help would be appreciated

Friskyweed avatar Feb 10 '21 03:02 Friskyweed

I have the inverse issue. My hands will raise up some when I look straight ahead or higher. I can only see it in mirrors because if I look down at my hands they look normal, but I've had other users verify.

LucaFox avatar Jun 20 '21 13:06 LucaFox

This is due to IKTweaks not wanting your viewpoint to drift. VRChat's default IK calculates your head from your hip, so it doesn't have that problem.

A simple fix would be to have a setting called "Head position weight" to change how the head's position is calculated. 0 would be equivalent to vrc's default and 1 would be what IKTweaks does (headPosition being the same as IKPositionHead)

Hope you don't mind me messing with your mod... I managed to implement that fix after figuring out how everything worked...

The head position in IKSolverVRSpine.cs in public override void PreSolve() can simply be calculated like that:

headPosition = V3Tools.Lerp(IKPositionPelvis + (IKPositionHead - IKPositionPelvis).normalized * (head.solverPosition.y - pelvis.solverPosition.y), IKPositionHead, IKTweaksSettings.headPositionWeight.Value);

Erimelowo avatar Dec 24 '21 02:12 Erimelowo