List is empty when used in other method

public Listcopy = new List ();

Below I have a method that works, it receives the List AllowedActionst and I can use it in this method. However how do I use this List in another method in the same class?

  public void BettingRound (NetworkPlayer actors, int Xpos, int Ypos,  List AllowedActionst, int bet) {
    		//var foundScript = GetComponent<AllowedActions> () as AllowedActions;
    
    
    		List<string> copy = new List<string>(AllowedActionst);
    
    		foreach (string i in copy) { Debug.Log(i + "copyyyyy ");}

For example I tried using the AllowedActionst List in the below method in the same class, but
the list is always giving a null reference it is empty.

I tried therefore to copy the AllowedActionst List into a new List named copy and made it public.
But still the same issue, if I use if (copy.contains…) the list is always empty. Even though the Debug.Log above does say it has 4 strings in copy however as you can see below that Debug.Log always shows null.
In other words how do I use the contents of the AllowedActionst List in the below
sendBetToServer() method so that it still has the same contents?
I thought making it public by declaring it outside of the methods would make it work even though it is initalising in the BettingRound method.

Hope this makes sense.

public void sendBetToServer() {
		BetButtonPressed = true;
		string ActionActor = "Bet";


		foreach (string i in copy) { Debug.Log(i + "this always shows an empty List/ null reference???? ");}
		
		//List<Player> Activeplayerss = foundScript2.getActivePlayers(); 



	//	var foundScript55 = gameObject.GetComponent<AllowedActions>();
//		List<string> AllowedActio = foundScript55.GetAllowedActions ();

		GameObject fiets8 = GameObject.Find ("clone2");
		myslider = fiets8.GetComponent<Slider> ();


		if (copy.Contains ("Raise")) {	GameObject fiets1 = GameObject.Find ("clone1");
			fiets1.SetActive (false);}
		if (copy.Contains ("Raise")) {GameObject fiets2 = GameObject.Find ("clone2");
			fiets2.SetActive (false);}
		if (copy.Contains ("Check")) {GameObject fiets3 = GameObject.Find ("clone3");
			fiets3.SetActive (false);}
		if (copy.Contains ("Fold")) {GameObject fiets4 = GameObject.Find ("clone4");
			fiets4.SetActive (false);}
		if (copy.Contains ("Call")) {GameObject fiets5 = GameObject.Find ("clone5");
			fiets5.SetActive (false);}

You’re declaring a new copy variable in BettingRound(), which means you aren’t using the class variable. To help explain further:

public class Example {
	
	public int number = 10;
	
	public void test1() {
		int number = 20; // declaring a new variable with the same name, which only exists within this function
	}
	
	public void test2() {
		number = 20; // modifying the class variable
	}
	
	public void test3() {
		Debug.Log(number); // prints 10
		test1();
		Debug.Log(number); // prints 10 still, because the class variable didn't change
		test2();
		Debug.Log(number); // prints 20 now, because we changed the class variable
	}
	
}