Unity Raycast todas as camadas, exceto uma

RaycastHit hit = Physics2D.Raycast(position, direction,
                  	range, ~(1 << LayerMask.NameToLayer("Player"))))
Plimpton