Hey, that was MY story
Breaking my leg/ankle and going through immediate surgery to put in pins, plates, and screws was THE turning point for me. Granted, I did manage to lose about 30 pounds just from living alone (no one brought me food, I literally had to crawl to the kitchen to get it) and the loopy effect of the pain meds, but it was during that time that I just got completely FED UP- like my freak accident wouldn't have happened if I wasn't obese.
So, the second the doctor said "ok, you can put weight on it" I did. I made myself do it. I benefited by having a surgeon who believed in not babying his patients to "take it easy". He said that when I felt like putting weight on it, I could. So I did. I was not going to wait around to gain more weight or let scar tissue take over the area. I was SO excited to be able to walk again (even though I got some GREAT arms using my crutches

). It was truly a life changing process for me. I know it isn't for most people, but that is what I needed to happen.
So, the second you can move, move. The moment you can put weight on it, DO IT. When they tell you to do your physical therapy/swim/get on the exercise bike, do it. I worked very hard to make sure this would not be a lasting problem (I know a few people who have had similar injuries and are plagued with issues because they didn't move and rehab). After about 2 years, I had NO remaining symptoms, but I was determined. I demanded proper physical therapy. I moved the moment I could. I went to massage therapists and chiropractors to re-adjust and work out scar tissue. The hardware they put in bothered me, so I demanded they take them out after 6 months. I'll probably have issues with arthritis in the future, but today I am very active and that ankle is the strongest part of my body
Trust me, this is something that you can overcome. I was just starting a workout routine when this happened and I was SO mad. So I put it into action.
You CAN do this. You just have to work with it. This is not a reason to give up, but a reason to KEEP GOING.
In the meantime, I hope that you feel better! Mine was a freakish accident as well and everyone just sort of scratched their heads going, "Jen, I just don't know how you managed to do THAT much damage simply by standing there in hockey skates!" It's going to be tough, but you can do it!