Working with IK script. Code not working properly.

I am following this tutorial:

I have tried to translate the code to C# to the best of my ability and it does not work.

Here are the scripts:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[System.Serializable]
public class Fabrik : MonoBehaviour
{

    public List<FabrikLimb> limbs = new List<FabrikLimb>();
    public Transform target;
    private float totalLength = 0.0f;

    private void Start()
    {
        CalculateLengths();
    }
    private void Update()
    {
        if (InRange())
        {
            Solve();
        }
    }
    void CalculateLengths ()
    {
        for(int i = 0; i < limbs.Count; i++)
        {
            limbs[i].length = Vector3.Distance(limbs[i].inboard.position, limbs[i].outboard.position);
            totalLength += limbs[i].length;
        }
    }
    bool InRange()
    {
        float distToTarget = Vector3.Distance(limbs[0].inboard.position, target.position);
        if (totalLength > distToTarget)
        {
            return true;
        }
        return false;
    }
    void Solve ()
    {
        FinalToRoot();
        RootToFinal();
    }
    void FinalToRoot ()
    {
        Vector3 currentGoal = target.position;
        FabrikLimb currentLimb = limbs[limbs.Count - 1];
        while(currentLimb != null)
        {
            currentLimb.inboard.rotation = Quaternion.FromToRotation(Vector3.up, currentGoal - currentLimb.inboard.position);
            currentLimb.outboard.position = currentGoal;
            currentGoal = currentLimb.inboard.position;
            if(currentLimb.inboardLimb != null)
            {
                currentLimb = currentLimb.inboardLimb.GetComponent<FabrikLimb>();
            } else
            {
                currentLimb = null;
            }
        }
    }
    void RootToFinal ()
    {
        Vector3 currentInboardPosition = limbs[0].inboard.position;
        FabrikLimb currentLimb = limbs[0];
        while(currentLimb != null)
        {
            currentLimb.inboard.position = currentInboardPosition;
            currentInboardPosition = currentLimb.outboard.position;
            if(currentLimb.outboardLimb != null)
            {
                currentLimb = currentLimb.outboardLimb.GetComponent<FabrikLimb>();
            } else
            {
                currentLimb = null;
            }
        }
    }
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[System.Serializable]
public class FabrikLimb : MonoBehaviour
{
    public Transform inboard, outboard;
    public Transform inboardLimb, outboardLimb;
    public float length = 0.0f;
}

And here is the result:

And here is some extra screenshots if it helps:

I have tried recreating the code to C# to the best of my ability but it still is not working. Does anyone know what I need to fix?

Please describe what is not working, it is not easy to tell from your screenshots. Tip, put in numerous Debug.Log statements, they will help you debug and will show in the Console window.

The slim cubes you see in the screenshots are supposed to act as a visual representing the limbs of the arm. When you hit play, the joints A, B, and C along with the “Upper” and “Lower” arm empty objects are supposed to rotate and move in a way that gives the cubes the appearance of an arm reaching for the ball. What happens instead is the joints malfunction and the arm appears to “break” into two pieces. Joint A is supposed to be the shoulder, Joint B is supposed to be the elbow, and C is supposed to be the hand / end effector. While the “Upper Arm” is the Transform for the upper arm, and the “Lower Arm” is the Transform for the fore arm. The two cubes act as a visual representation of the upper and lower arm.

I found this example on GitHub, maybe it’s useful to you: GitHub - CaseySanchez/Unity3D-FABRIK: Unity3D implementation of FABRIK by Andreas Aristidou.
I’m looking for a way to implement head position IK for a VR player. Would be nice if we could control more than just hands and feet positions with Mecanim IK!