The weight can certainly contribute to it. Also, lack of exercise, in and of itself can be a contributing factor. When you exercise regularly, you keep all of your blood vessels working properly, including the ones that go into your sexual organs.
Another thing that can cause it is excessive alcohol consumption, too much pot smoking (especially the older you get) and whole bunch of prescriptions medications. Are you taking any meds?
High blood pressure can also contribute to the problem.
Your best bet is to get a full physical (I’m due for mine this month, so let’s schedule an appt. for both of us tomorrow) and let the doctor know the whole truth. Believe me, they’ve seen and heard it all, nothing to be embarrassed about. Good luck : )