// The custom constructor public Foot (IKSolver solver, Transform transform) { this.solver = solver; this.transform = transform; this.leg = null; rotation = transform.rotation; }
// Set the effector positionOffset for the foot private void SetLegIK(IKEffector effector, Grounding.Leg leg) { effector.positionOffset += (leg.IKPosition - (effector.bone.position + effector.positionOffset)) * weight; effector.bone.rotation = Quaternion.Slerp(Quaternion.identity, leg.rotationOffset, weight) * effector.bone.rotation; }