void CheckTileRemoval() { Collider2D col; if (col = Physics2D.OverlapPoint(mousePos, roomLayer)) { Vector2 center = col.gameObject.transform.position; RoomGrid rg = col.gameObject.GetComponent <RoomGrid>(); Rect eraseRect = new Rect(mousePos.x, mousePos.y, 25, 25); rg.EraseBlock(eraseRect, selectedItemTab, center); } }