i made a dropdown and some code by following a tutorial, and whats supposed to happen is it is supposed to automatically set the options to be different resolution options, but it isnt working
screenshot of what it looks like (not what its supposed to look like):

heres a error that came along with this issue:
NullReferenceException: Object reference not set to an instance of an object
MenuController.SetResolution (System.Int32 resolutionIndex) (at Assets/MenuController.cs:91)
UnityEngine.Events.InvokableCall1[T1].Invoke (T1 args0) (at <d3b66f0ad4e34a55b6ef91ab84878193>:0) UnityEngine.Events.UnityEvent1[T0].Invoke (T0 arg0) (at :0)
TMPro.TMP_Dropdown.SetValue (System.Int32 value, System.Boolean sendCallback) (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMP_Dropdown.cs:431)
TMPro.TMP_Dropdown.set_value (System.Int32 value) (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMP_Dropdown.cs:406)
TMPro.TMP_Dropdown.OnSelectItem (UnityEngine.UI.Toggle toggle) (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMP_Dropdown.cs:1155)
TMPro.TMP_Dropdown+<>c__DisplayClass70_0.b__0 (System.Boolean x) (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMP_Dropdown.cs:820)
UnityEngine.Events.InvokableCall1[T1].Invoke (T1 args0) (at <d3b66f0ad4e34a55b6ef91ab84878193>:0) UnityEngine.Events.UnityEvent1[T0].Invoke (T0 arg0) (at :0)
UnityEngine.UI.Toggle.Set (System.Boolean value, System.Boolean sendCallback) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Toggle.cs:280)
UnityEngine.UI.Toggle.set_isOn (System.Boolean value) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Toggle.cs:243)
UnityEngine.UI.Toggle.InternalToggle () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Toggle.cs:313)
UnityEngine.UI.Toggle.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Toggle.cs:324)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:50)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:262)
UnityEngine.EventSystems.EventSystem:Update() (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)
and here is the code:
public void SetResolution(int resolutionIndex)
{
Resolution resolution = resolutions[resolutionIndex];
Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen);
}
private void start()
{
resolutions = Screen.resolutions;
ResolutionDropdown.ClearOptions();
List<string> options = new List<string>();
int currentResolutionIndex = 0;
for (int i = 0; i < resolutions.Length; i++)
{
string option = resolutions[i].width + " x " + resolutions[i].height;
options.Add(option);
if(resolutions[i].width == Screen.width && resolutions[i].height == Screen.height)
{
currentResolutionIndex = i;
}
}
[Header("Resolution Dropdowns")]
public TMP_Dropdown ResolutionDropdown;
private Resolution[] resolutions;
