Hello, Tammy and welcome!
I'm so sorry to hear that your cat seems to be having trouble with his hind legs.
There are various causes for the symptoms you describe. He might have developed vestibular syndrome, which adversely affects balance/equilibrium and makes a cat feel dizzy, so he can't walk straight. He may be walking funny, because he's trying to maintain his balance. Very often, the source of this problem is an ear infection. Here is more information:
In an older cat, the possibilities exist for the development of diabetes or a cardiac condition called feline cardiomyopathy, which can cause weakness in the hind legs. With diabetes, diabetic neuropathy weakens the nerves in the hind legs and make them very weak and sometimes, the cat cannot walk at all, if it's very advanced. With Cardiomyopathy, a blood clot is formed in the main artery leading to the hind legs and can cause blood flow to stop to this area. Typically, the paw pads will feel very cold, compared with the front pads and they may even appear bluish or purplish, if their normal color is pink. This is usually a painful condition, accompanied by paralysis in some cases.
if you were moving your cat's legs and he showed no discomfort, this is good, if they're not painful, but the sudden onset of this symptom needs to be checked out in person by a vet, as soon as possible.
It would be advisable to have your kitty seen at an ER vet center now, if you can, so he can be evaluated, diagnosed and treated.
I hope all will be well with your furry boy!
Please be so kind as to rate my answer with positive feedback; that is the only way I receive recognition from the site for my assistance. Thank you very much!
Providing a positive rating will not end our conversation, should you need me for any follow-up. Simply click 'Reply' for clarification or additional information, if needed, and I will be happy to continue.