Problem with elevator

Hello, I am a beginner to unity and programming in general. I made an elevator that moves up and down. But when my character controller uses this elevator it wierdly bumps and jitters.

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

public class PlatformMoving : MonoBehaviour, IInteractable
{
    public bool _canMove;

    private TextAsset _interactText;

    [SerializeField] float _speed;
    [SerializeField] int _startPoint;
    [SerializeField] Transform[] _points;

    int i;
    bool reverse;

    private void Start()
    {
        transform.position = _points[_startPoint].position;
        i = _startPoint;
    }


    private void Update()
    {

        if(Vector3.Distance(transform.position, _points[i].position) < .01f)
        {
            _canMove = false;
            if(i == _points.Length - 1)
            {
                reverse = true;
                i--;
                return;
            }
            else if (i == 0)
            {
                reverse = false;
                i++;
                return;
            }

            if(reverse)
            {
                i--;
            }
            else
            {
                i++;
            }
        }

        if(_canMove)
        {
            transform.position = Vector3.MoveTowards(transform.position, _points[i].position, _speed * Time.deltaTime);
        }
    }

    public void Interact()
    {
        MovePlatform();
    }


    private void MovePlatform()
    {
        _canMove = true;
    }
    public TextAsset GetInteractText()
    {
        return _interactText;
    }
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ParentPlatform : MonoBehaviour
{
    private Vector3 lastPlatformPosition;

    private void OnCollisionEnter(Collision collision)
    {
      
        collision.transform.SetParent(transform);
       
        lastPlatformPosition = transform.position;
    }

    private void OnCollisionStay(Collision collision)
    {
      
        Vector3 platformDelta = transform.position - lastPlatformPosition;
        lastPlatformPosition = transform.position;

        collision.transform.position += platformDelta;
    }

    private void OnCollisionExit(Collision collision)
    {
        collision.transform.SetParent(null);
    }
}

I am Assuming your character controller has a Rigidbody.
You could make the character controllers Rigidbody kinematic while on the elevator when you make the platform the parent and then set it back with OnCollisionExit. Rigidbodies will still try to do their thing even if they have a parent transform.

Other advice

when moving objects that have anything to do with physics its usually best to use FixedUpdate instead of Update as this will make them move in synchronization with the internal physics update.

Also instead of using transform position to move the platform, give the platform a kinematic Rigidbody and move it using Rigidbody.position. weird things sometimes happen when moving physics objects with transform.position and when a collider with a Rigidbody and a collider without are both moving and colliding.

Why are you making the parent the platform btw? Is it to make sure the player cant get off early?
You could keep the two objects sperate and make an invisible collider/colliders to use as a barrier while the platform is moving and toggle them off again when the platform is at the end of its movement. Or just limit the player controllers Rigidbody.position while on the platform.