An analyte sensor and a method for making the analyte sensor are disclosed. In one aspect, the analyte sensor includes a crosslinked, hydrophilic copolymer in contact with a surface of an electrode, and an analyte sensing component embedded within the crosslinked, hydrophilic copolymer. The method of making the analyte sensor includes depositing a precursor mixture containing monomers and an analyte sensing component onto an electrode, exposing the deposited precursor mixture to a controlled environment for a specified period of time, and photopolymerizing the deposited exposed precursor mixture into a copolymer layer in contact with a surface of the electrode. Exposing the deposited precursor mixture to a controlled environment can increase the sensitivity of the sensor by reducing the thickness of the copolymer layer and/or by causing the analyte sensitive component within the copolymer layer to have a non-uniform concentration within the layer.