What's wrong in this 1 line?

void DisableKey( KeyCode key )
{
if( Event.current.keyCode == key ( Event.current.type == EventType.KeyUp || Event.current.type == EventType.KeyDown ) )
{
Event.current.Use();

		}
	}

here’s the error i am getting → Assets/Scripts/FadeScript.cs(39,34): error CS0119: Expression denotes a variable’, where a method group' was expected

i cannot understand what is wrong in this line.

please help

thanks in advance.

Hi, you forget to put an “And (&&)” or “Or (||)” statement in your if so the programe think you are trying to call a function named “Key” but “Key” is a varible…

 if( Event.current.keyCode == key ***Here*** ( Event.current.type == EventType.KeyUp || Event.current.type == EventType.KeyDown ) )

Hope this help

" key " is not a method and you’re trying to use it as a method

void DisableKey( KeyCode key )
	{
		if( Event.current.keyCode == key || Event.current.type == EventType.KeyUp || Event.current.type == EventType.KeyDown )
		{
			Event.current.Use();
			
		}
	}