public States Main_Grab(States currentState) { otherState.currentState = States.IN_GRAB; mechanics.GrabAttach(gameObject, otherPlayer); if (!command.Grab()) //grab key { mechanics.GrabDeattach(otherPlayer); return(States.IDLE); } else if (command.MoveLeft()) //move key { mechanics.MoveLeft(); } else if (command.MoveRight()) //move key { mechanics.MoveRight(); } return(currentState); }