What is a string method group?

I was searching around and i cant find the solution to this:

// Update is called once per frame
void Update () {
	if (Input.GetKey("up"))
	{
		selectnewgame = true;
	}
	if (Input.GetKey ("down")) {
		selectnewgame = false;
	}
	if (Input.GetKey("return")
		(selectnewgame = true))
	{
		SceneManager.LoadScene ("BeforeNight1");
			
}

Then, the erro says this:
Assets/NewGameScript.cs(24,13): error CS0119: Expression denotes a value, where a `method group’ was expected

What do i do?

Here’s the problem.

if (Input.GetKey("return")
(selectnewgame = true))

Short answer: It has to look like this:

if (Input.GetKey("return")) // bracket!
{
  selectnewgame = true; // no brackets, but a semicolon!
  SceneManager.LoadScene ("BeforeNight1");

Long answer: This piece of Code

Input.GetKey("return")

returns a boolean (true/yes or false/no). So, just for this explanations, let’s write a boolean value directly instead:

true

Now, let’s put the same code after this that you have up there:

Input.GetKey("return")(selectnewgame = true)

becomes

true(selectnewgame = true)

What the compiler sees here is a method call (a word with brackets behind it), but true is not a method, but a value. You can perhaps see how the error message you got starts to make sense now.

The newline between Input.GetKey( ... ) and the brackets after that doesn’t matter.

You have this line:

if (Input.GetKey("return") (selectnewgame = true))

Which basically does this: GetKey returns a boolean value, true or false. You have placed “()” brackets behind that value. This means you try to “call” that value like a method or method group (multicast delegate). However you can not “execute” a bool value.

It’s not clear what you intended to do here. Do you want to check if "selectnewgame " is true before you load the new level? Or do you want to set selectnewgame to true when the return key is pressed?

In the first case you have to do

if (Input.GetKey("return") && selectnewgame)
{
    SceneManager.LoadScene ("BeforeNight1");
}

In the second case it should look like this:

if (Input.GetKey("return"))
{
    selectnewgame = true;
    SceneManager.LoadScene ("BeforeNight1");
}