Regularity results for solutions to a class of obstacle problems. (December 2021)