Nobody looks at the error numbers. The entire error message is important, including the line numbers they occur on.
You have to make sure your braces are paired up. Every opening brace needs a closing brace.
You should pick a single brace style and stick with it. You have a combination of styles where the opening brace is either on the same line as a line of code and where it's on its own line.
This also applies to parenthesis. And in your code, that's where it's screwed up.
public void playSoundEffect()
{
if (Input.GetKeyDown("f") && public bool KnifePickedUp = true;)
{
KnifeGrab.Play();
}
}
The bolded portion is defining a variable, but that's not legal in an
if
condition expression. I'd guess that you're looking for this instead:
public void playSoundEffect()
{
if (Input.GetKeyDown("f") && KnifePickedUp = true)
{
KnifeGrab.Play();
}
}