Assume the role of a unity developer, specialising in unity 20202.2.6f1. I will provide you with some scripts, can you analyse them and write me a new system that deals with grinding to fully replace the old system, retain any logic necessary. I feel there should be a grind script that goes onto the Hoverboard (player) and one that attaches to the grindable object. Ask questions for context if needed, don't assume,  Here are the 4 scripts
Script 1
using UnityEngine;

public class Grind : MonoBehaviour
{
	public enum Direcao
	{
		ZY = 0,
		XY = 1
	}

	[Header("Info")]
	[SerializeField]
	private GameObject player;

	private Vector3 playerTr;

	[SerializeField]
	private GameObject pos;

	private Vector3 posMax;

	private Vector3 posMin;

	public Direcao direcao;

	[SerializeField]
	private float angleMax = 65f;

	[SerializeField]
	private bool lado;

	public bool dir;

	[Space(10f)]
	[Header("Lado A")]
	[SerializeField]
	private GameObject a;

	[SerializeField]
	private float aDis;

	[SerializeField]
	private float aAngle;

	[SerializeField]
	private bool aVer;

	[Space(10f)]
	[Header("Lado B")]
	[SerializeField]
	private GameObject b;

	[SerializeField]
	private float bDis;

	[SerializeField]
	private float bAngle;

	[SerializeField]
	private bool bVer;

	private void Update()
	{
		LadoVer();
		dir = lado;
		if (Vector3.Distance(base.transform.position, player.transform.position) < 12f)
		{
			posQueda();
		}
		else
		{
			pos.transform.localPosition = new Vector3(0f, 0f, 0f);
		}
	}

	private void LadoVer()
	{
		aDis = Vector3.Distance(player.transform.position, a.transform.position);
		bDis = Vector3.Distance(player.transform.position, b.transform.position);
		aAngle = Vector3.Angle(player.transform.forward, a.transform.position - player.transform.position);
		bAngle = Vector3.Angle(player.transform.forward, b.transform.position - player.transform.position);
		if (aAngle < angleMax)
		{
			aVer = true;
		}
		else
		{
			aVer = false;
		}
		if (bAngle < angleMax)
		{
			bVer = true;
		}
		else
		{
			bVer = false;
		}
		if (aVer && bVer && aDis > bDis)
		{
			lado = true;
		}
		else if (aVer && !bVer)
		{
			lado = true;
		}
		else if (bVer && aVer && bDis > aDis)
		{
			lado = false;
		}
		else if (bVer && !aVer)
		{
			lado = false;
		}
		else if (bDis > aDis)
		{
			lado = false;
		}
		else if (aDis > bDis)
		{
			lado = true;
		}
	}

	private void posQueda()
	{
		playerTr = player.transform.position;
		posMax = a.transform.position;
		posMin = b.transform.position;
		if (direcao == Direcao.XY)
		{
			pos.transform.position = new Vector3(playerTr.x, pos.transform.position.y, pos.transform.position.z);
			pos.transform.localPosition = new Vector3(pos.transform.localPosition.x, 0f, pos.transform.localPosition.z);
		}
		else if (direcao == Direcao.ZY)
		{
			pos.transform.position = new Vector3(pos.transform.position.x, pos.transform.position.y, playerTr.z);
			pos.transform.localPosition = new Vector3(pos.transform.localPosition.x, 0f, pos.transform.localPosition.z);
		}
	}
}
Script 2
using UnityEngine;
using UnityEngine.UI;

public class PlayerGrindController : MonoBehaviour
{
    [Header("Grind Settings")]
    public float grindSpeed = 0.1f;
    public bool isGrinding;

    public Transform grindPosition; // The target position on the grindable object
    public Transform localGrindDirection; // The direction of grinding (if needed)

    [Header("Grind UI")]
    public Slider grindBalanceSlider; // Assign this in the inspector

    private float grindBalance; // Represents the current balance while grinding
    private float grindBalanceTime = 4f; // Time after which the grind balance changes direction
    private bool continueGrinding; // Indicates if grinding should continue forward
    private bool intermediateMode; // Determines if the intermediate position is active
    private Transform intermediatePoint; // Optional intermediate grinding point

    private float balanceValue; // Randomly set value used to simulate balance change

    private void Update()
    {
        if (isGrinding)
        {
            GrindBalanceManager();
            GrindMovement();
        }
    }

    private void GrindBalanceManager()
    {
        // Modify the slider value over time and check if the player keeps their balance
        grindBalance += Time.deltaTime;
        if (grindBalance >= grindBalanceTime)
        {
            grindBalance = 0f;
            balanceValue = Random.Range(-30, 30); // Simulate a balance value change
        }

        // Example logic to move the grind balance slider towards the balanceValue
        grindBalanceSlider.value = Mathf.MoveTowards(grindBalanceSlider.value, balanceValue, 10f * Time.deltaTime);
    }

    private void GrindMovement()
    {
        if (continueGrinding)
        {
            // If in intermediate mode, move towards the intermediate point first
            if (intermediateMode)
            {
                if (Vector3.Distance(transform.position, intermediatePoint.position) <= 1.5f)
                {
                    intermediateMode = false;
                }
                else
                {
                    transform.position = Vector3.MoveTowards(transform.position, intermediatePoint.position, grindSpeed * Time.deltaTime);
                }
            }
            // Otherwise, move towards the main grind direction
            else
            {
                transform.position = Vector3.MoveTowards(transform.position, localGrindDirection.position, grindSpeed * Time.deltaTime);
            }
        }
    }

    public void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("GrindableSurface"))
        {
            StartGrinding(other.transform);
        }
    }

    public void OnTriggerExit(Collider other)
    {
        if (other.CompareTag("GrindableSurface"))
        {
            EndGrinding();
        }
    }

    public void StartGrinding(Transform grindSurface)
    {
        isGrinding = true;
        continueGrinding = true;
        // Assign references or find child objects on the grindSurface to set up grinding
        grindPosition = grindSurface.GetChild(0); // Set this according to your grind object setup
        intermediatePoint = null; // Set this according to your grind object setup
        intermediateMode = false; // Set this according to your grind object setup
        localGrindDirection = grindSurface; // Example value, replace with actual alignment logic

        grindBalanceSlider.gameObject.SetActive(true); // Show the slider when grinding starts
    }

    public void EndGrinding()
    {
        isGrinding = false;
        continueGrinding = false;
        intermediateMode = false;

        grindBalanceSlider.gameObject.SetActive(false); // Hide the slider when grinding ends
    }
}
Script 3
using UnityEngine;
using UnityEngine.UI;

[RequireComponent(typeof(Rigidbody))]
public class HoverBoardControl : MonoBehaviour
{
    [Header("Hover Settings")]
    public float hoverForce = 9.0f;
    public float hoverHeight = 2.0f;
    public GameObject[] hoverPoints;

    [Header("Movement Settings")]
    public float forwardAcceleration = 100.0f;
    public float backwardAcceleration = 25.0f;
    public float turnStrength = 10f;

    [Header("UI & Scoring")]
    public Text scoreText;
    public int currentScore;
    public HUD hud;
    public TrickManager trickManager;

    [Header("Boost Settings")]
    public float boostMultiplier = 2.0f;

    [Header("Rotation Settings")]
    public float minRotation = -20.0f;
    public float maxRotation = 0.0f;

    [Header("Timer Settings")]
    public float timer = 5.0f;

    [Header("Miscellaneous")]
    public bool moving;
    public GameObject board;

    [Header("Input Settings")]
    public KeyCode moveForwardKey = KeyCode.W;
    public KeyCode moveBackwardKey = KeyCode.S;
    public KeyCode turnLeftKey = KeyCode.A;
    public KeyCode turnRightKey = KeyCode.D;

    [Header("Customizable Keys")]
    [SerializeField] private KeyCode ollieKey = KeyCode.Space;
    [SerializeField] private KeyCode boostKey = KeyCode.LeftControl;

    int layerMask;
    float currentThrust;
    float currentTurn;

    Rigidbody rb;

    void Awake()
    {
        rb = GetComponent<Rigidbody>();
        hud = FindObjectOfType<HUD>();
        trickManager = GetComponent<TrickManager>();
    }

    void Start()
    {
        layerMask = 1 << LayerMask.NameToLayer("Characters");
        layerMask = ~layerMask;

        hoverForce = 1500f;
        hoverHeight = 6f;

        if (scoreText == null)
        {
            GameObject canvas = GameObject.Find("Canvas");
            if (canvas != null)
            {
                scoreText = Instantiate(Resources.Load("ScoreText", typeof(Text))) as Text;
                scoreText.transform.SetParent(canvas.transform, false);
            }
            else
            {
                Debug.LogError("Canvas not found. Make sure there is a Canvas GameObject in the scene.");
            }
        }
    }

    void OnEnable()
    {
        // Reset physics properties if needed when hoverboard control is enabled
        rb.isKinematic = false;
        rb.useGravity = true;
    }

    void OnDisable()
    {
        // Stop the hoverboard movement by making it kinematic or directly setting velocity to zero as needed
        rb.velocity = Vector3.zero;
        rb.angularVelocity = Vector3.zero;
        rb.isKinematic = true;
    }

    void Update()
    {
        currentThrust = 0.0f;
        currentTurn = 0.0f;

        scoreText.text = currentScore + " Points";

        if (Input.GetKeyDown(ollieKey))
        {
            trickManager.ExecuteOllieOrTrick(1500f);
        }

        if (hud != null)
        {
            if (Input.GetKeyDown(boostKey) && (hud.BoostInt > 0))
            {
                forwardAcceleration = forwardAcceleration * boostMultiplier;
                backwardAcceleration = backwardAcceleration * boostMultiplier;

                if (hud.BoostInt <= 0)
                {
                    forwardAcceleration = forwardAcceleration / boostMultiplier;
                    backwardAcceleration = backwardAcceleration / boostMultiplier;
                }
            }

            if (Input.GetKey(boostKey))
            {
                hud.BoostInt -= 0.2f;
            }
        }

        Vector3 currentRotation = transform.rotation.eulerAngles;
        currentRotation.x = Mathf.Clamp(currentRotation.x, minRotation, maxRotation);
        currentRotation.z = Mathf.Clamp(currentRotation.z, minRotation, maxRotation);
        transform.rotation = Quaternion.Euler(currentRotation);

        float aclAxis = Input.GetAxis("Vertical");
        if (aclAxis > 0.1f)
            currentThrust = aclAxis * forwardAcceleration;
        else if (aclAxis < -0.1f)
            currentThrust = aclAxis * backwardAcceleration;

        float turnAxis = Input.GetAxis("Horizontal");
        if (Mathf.Abs(turnAxis) > 0.1f)
            currentTurn = turnAxis;

        if (Input.GetKeyDown(trickManager.kickflipKey))
        {
            trickManager.ExecuteKickflip();
        }
        else if (Input.GetKeyDown(trickManager.heelflipKey))
        {
            trickManager.ExecuteHeelflip();
        }
        else if (Input.GetKeyDown(trickManager.shoveItKey))
        {
            trickManager.ExecuteShoveIt();
        }

        // Your additional Update logic, if any...
    }

    void FixedUpdate()
    {
        ApplyHover();
        ApplyMovement();
        ApplyTurning();
    }

    void ApplyHover()
    {
        for (int i = 0; i < hoverPoints.Length; i++)
        {
            var hoverPoint = hoverPoints[i];
            RaycastHit hoverHit;
            if (Physics.Raycast(hoverPoint.transform.position, -Vector3.up, out hoverHit, hoverHeight, layerMask))
            {
                rb.AddForceAtPosition(Vector3.up * hoverForce * (1.0f - (hoverHit.distance / hoverHeight)), hoverPoint.transform.position);
            }
            else
            {
                if (transform.position.y > hoverPoint.transform.position.y)
                {
                    rb.AddForceAtPosition(hoverPoint.transform.up * hoverForce, hoverPoint.transform.position);
                }
                else
                {
                    rb.AddForceAtPosition(hoverPoint.transform.up * -hoverForce, hoverPoint.transform.position);
                }
            }
        }
    }

    void ApplyMovement()
    {
        if (Mathf.Abs(currentThrust) > 0)
        {
            rb.AddForce(transform.forward * currentThrust);
        }
    }

    void ApplyTurning()
    {
        if (currentTurn > 0)
        {
            rb.AddRelativeTorque(Vector3.up * currentTurn * turnStrength);
        }
        else if (currentTurn < 0)
        {
            rb.AddRelativeTorque(Vector3.up * currentTurn * turnStrength);
        }
    }
}
Script 4 
using UnityEngine;

public class PlayerHoverboardInteraction : MonoBehaviour
{
    [Header("Interaction Settings")]
    public KeyCode getOnKey = KeyCode.E;
    public KeyCode getOffKey = KeyCode.E;
    public GameObject playerModel;
    public GameObject hoverboard;
    public Transform hoverboardStandPosition; // Assign a transform position to stand on the hoverboard

    private bool isOnHoverboard = false;

    // Reference to player and hoverboard control scripts
    public playerController playerControllerManager; // Assuming your playerController script name is ‘PlayerController’
    public HoverBoardControl hoverBoardControl; // Assuming your hoverboard control script name is ‘HoverBoardControl’

    // Camera references for player and hoverboard
    [Header("Camera Settings")]
    public Camera playerMainCamera; // Player’s main camera
    public Camera hoverboardCamera; // Hoverboard’s camera

    private Rigidbody playerRigidbody;
    private Collider playerCollider;

    void Start()
    {
        // Cache references to the player’s Rigidbody and Collider
        playerRigidbody = playerModel.GetComponent<Rigidbody>();
        playerCollider = playerModel.GetComponent<Collider>();

        // Disable hoverboard control at the start.
        hoverBoardControl.enabled = false;

        // Ensure the hoverboard camera is also disabled at the start
        if (hoverboardCamera != null)
            hoverboardCamera.enabled = false;

        // Additional start initialization, if needed
    }

    void Update()
    {
        if (!isOnHoverboard && Input.GetKeyDown(getOnKey) && CanGetOnHoverboard())
        {
            GetOnHoverboard();
        }
        else if (isOnHoverboard && Input.GetKeyDown(getOffKey))
        {
            GetOffHoverboard();
        }
    }

    private bool CanGetOnHoverboard()
    {
        return hoverboard != null;
    }

    private void GetOnHoverboard()
    {
        if (!CanGetOnHoverboard())
            return;

        isOnHoverboard = true;

        // Positioning the player on the hoverboard
        playerModel.transform.position = hoverboardStandPosition.position;
        playerModel.transform.rotation = hoverboardStandPosition.rotation;
        playerModel.transform.SetParent(hoverboardStandPosition);

        // Disabling player controls and collider
        playerControllerManager.enabled = false;
        playerRigidbody.isKinematic = true;
        playerCollider.enabled = false;

        // Enabling hoverboard control
        hoverBoardControl.enabled = true;

        // Switch cameras
        if (playerMainCamera != null)
            playerMainCamera.enabled = false;

        if (hoverboardCamera != null)
            hoverboardCamera.enabled = true;
    }

    private void GetOffHoverboard()
    {
        isOnHoverboard = false;

        // Detach player from hoverboard and apply a small upward and forward offset
        playerModel.transform.SetParent(null);
        playerModel.transform.Translate(0, 1f, 1f);

        // Re-enabling player controls and collider
        playerControllerManager.enabled = true;
        playerRigidbody.isKinematic = false;
        playerCollider.enabled = true;

        // Disabling hoverboard control
        hoverBoardControl.enabled = false;

        // Switch cameras back to the player’s main camera
        if (hoverboardCamera != null)
            hoverboardCamera.enabled = false;

        if (playerMainCamera != null)
            playerMainCamera.enabled = true;
    }
}