If Statement is not working...

I’m trying to make a drag and drop kinda program, but when i add an if statement I got and error saying: expecting ) found {, and: expecting EOF found }… here is the code its the 2 main brakets that have the error

if(Input.GetMouseButtonUp(0){

          if(addhouse.A!=0){

other.GetComponent(addhouse).A -= 1;}

          }

First, please make sure your code is corectly formated for easy reading.

Second, here is a fixed code:

if(Input.GetMouseButtonUp(0)){

      if(addhouse.A!=0){

          other.GetComponent(addhouse).A -= 1;

          }

      }

As the error suggests, you where missing a ).

if(Input.GetMouseButtonUp(0))
{
if(addhouse.A!=0)
other.GetComponent(addhouse).A -= 1;
}

You just need to add a ’ ) ’ after (0) , as the message tells you