TripleMonkey47
TripleMonkey47

Reputation: 1

error CS1501: No overload for method `ToString` takes '1' arguments

private int Score;

public void Update ()
{
    var t = ToString(Score);
    if (ElementCompleted == true)
    {
        Score += 1;
        ElementCompleted = false;
    }
}

This gives me an error:

No overload for method ToString takes '1' arguments

Can anyone help me? I am not using ToString anywhere else in my project.

Upvotes: 0

Views: 2311

Answers (2)

Maxwell Sweikert
Maxwell Sweikert

Reputation: 19

it's telling you there is not a method toString() that takes 1 arguments because any toString method should always takes 0 arguments and you have sent it 1 argument score

Upvotes: 0

Daniel A. White
Daniel A. White

Reputation: 190925

Don't you mean to do Score.ToString()?

Otherwise, you are doing this.ToString().

Upvotes: 6

Related Questions