public ListMode locationMode = new ListMode("Default", ListMode.ListModeType.Default); // Will do the mode with 0 index (top of list); void Start() { try { sortByDropdownDefaultPosition = sortByDropdown.GetComponent <RectTransform>().anchoredPosition; filterDropdownDefaultPosition = filterDropdown.GetComponent <RectTransform>().anchoredPosition; searchBarDefaultPosition = searchBar.GetComponent <RectTransform>().anchoredPosition; } catch (NullReferenceException) { } }