Hey Guys, ima trying to bring my Player Names into the next scene, but it doesnt work, these are my scrpits

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

public class MySettings : MonoBehaviour
{
public string playernamestr;
public Text playername;
void Start()
{
playernamestr = playername.text;

     }    

}

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

public class Names : MonoBehaviour
{
public string theName;
public GameObject inputField;
public GameObject textDisplay;
public InputField playername;

private string names;
private int index = 0;


 
public void StoreName()
{
    Debug.Log("Player Name is:" + playername.text);
    MySettings.palyernamestr = playername.text;

    theName = inputField.GetComponent<Text>().text;
    if (index > 0)
    {
        names = names + ", " + theName;
    }
    else
    {
        names = names + theName;
    }
    index += 1;
    textDisplay.GetComponent<Text>().text = names;
}  

}

You should use a ScriptableObject or non MonoBevaviour class, that way the value will persist through scene changes. Only MonoBehaviours are destroyed during scene changes.