how t make a random number generator for a 2d endless side scroller

I have tried for so long and I have got this far to figure this much out can any one help me using the script that I provide
`public class PlatformManager : MonoBehaviour
{
public int startingNumber;
public List levelComponents;
5. // define it as the height on one or more component objects (The actual value you will need to find out)
public float componentBuffer;
public float screenBuffer;
public List platformList;

10.    private Vector3 nextPosition;
    private Transform player;
 
    void Start()
    {
15.       nextPosition = new Vector3(0.0f, -componentBuffer, 0.0f);
       platformList = new List<Transform>();
       for (int i = 0; i < startingNumber; i++)
       {
          int randComponent = Random.Range(0, levelComponents.Count);
20.          GameObject newPlatform = PoolManager.Spawn(levelComponents[randComponent]);
          newPlatform.transform.position = nextPosition;
          platformList.Add(newPlatform.transform);
          nextPosition.y -= componentBuffer;
       }
25.    }
 
    void Update()
    {
       if (player == null)
30.       {
         player = GameObject.Find("Player(Clone)").transform;
       }
       else
       {
35.         if (nextPosition.y > player.position.y - screenBuffer)
         {
            int randComponent = Random.Range(0, levelComponents.Count);
            GameObject newPlatform = PoolManager.Spawn(levelComponents[randComponent]);
            newPlatform.transform.position = nextPosition;
40.            platformList.Add(newPlatform.transform);
            nextPosition.y -= componentBuffer;
         }
 
         if (platformList[0].position.y > player.position.y + screenBuffer)
45.         {
            PoolManager.Despawn(platformList[0].gameObject);
            platformList.RemoveAt(0);
         }
       }
50.    }
`

you get random numbers from Random.Range and PerlinNoise in Unity.

if you make the random number a function of position/pixels, you do (perlin noise((x+y float, seed)*500 )+x) %1= different float between 0 and 1 for every 2d point in space. the plus x at the end stops perlin from having a bell curve and makes it linear.