Tummy pain

Recently whenever i have sex or sometimes masturbate afterwards I get a pain in my tummy like cramping i guess but different ...does anyone know what it is? Apparently it could be muscle pain because they tighten during that stuff but idk

I recently went off the pill if that means anything