error CS1503: Argument 1: cannot convert from 'System.Collections.Generic.List<string>' to 'string'

error CS1503: Argument 1: cannot convert from 'System.Collections.Generic.List<string>' to 'string'

Anonymous
Not applicable
7,241 Views
3 Replies
Message 1 of 4

error CS1503: Argument 1: cannot convert from 'System.Collections.Generic.List<string>' to 'string'

Anonymous
Not applicable

Hey, i'm making this game and this error just showed up and i cant find a way to solve it. Pls help :'(((

 

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

public class FullScreen : MonoBehaviour
{
public Dropdown resolutionDropdown;

Resolution[] resolutions;

void Start()
{
resolutions = Screen.resolutions;

resolutionDropdown.ClearOptions();

List<string> options = new List<string>();

for (int i = 0; i < resolutions.Length; i++)
{
string option = resolutions[i].width + "x" + resolutions[i].height;
options.Add(options);
}

resolutionDropdown.AddOptions(options);
}
public void SetFullCreen (bool isFullScreen)
{
Screen.fullScreen = isFullScreen;
}

}

0 Likes
7,242 Views
3 Replies
Replies (3)
Message 2 of 4

joshua.lumley
Advocate
Advocate

lol, I was about to say this is a rookie error, then I realized you on the wrong website altogether.   

This is a Revit API forum.

Message 3 of 4

MarryTookMyCoffe
Collaborator
Collaborator

how some one can fail so much, maybe life of programmer is just not for you.
btw you made typo here

options.Add(options);

 but you probably will not read this just like you didn't read a exception description, debug info in unity, name of the forum and probably your own code.

-------------------------------------------------------------
--------------------------------|\/\/|------------------------
do not worry it only gonna take Autodesk 5 years to fix bug
Message 4 of 4

mhannonQ65N2
Collaborator
Collaborator

This is actually a very simple error that is easy to make (the error in the code that is). In your for loop you typed options.Add(options); instead of options.Add(option);.

0 Likes