The temperature of a substance is a measure of the average kinetic energy of its molecules. During melting, or phase change, there is no change in temperature, hence, the average kinetic energy of the molecules does not change, but the separation between molecules on average increases.