Dropdown.ClearOptions does not work

I am trying to save a new string to my medicin list, and save it with playerPrefs. I then want to clear out my dropdown menu options, and then add the medicin list.

m
The problem is, i can’t get my dropdown menu to clear. i am using dropdown.ClearOptions: Unity - Scripting API: UI.Dropdown.ClearOptions

I am getting the error: Assets\dropdownList.cs(65,9): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement.

I really have no idea why i can’t simply clear the dropdown list.

public InputField addItem;
public Dropdown menu;
public List medicin = new List() { “”, “Primcillin 800 MG 1x3 i 10 dage” };

public void AddToList ()
{

        medicin.Add(addItem.text);


        
        for (int i = 0; i < medicin.Count; i++)
        {
            PlayerPrefs.SetString("med" + i, medicin*);*

}

menu.ClearOptions;
menu.AddOptions(medicin);
}

Try

menu.ClearOptions();

:slight_smile: