Ex advice!!

A month ago me and my ex reconnected after not speaking for a year after a bad breakup. Things were good and we agreed to be friends. We hung out with each other a couple weeks later and then slept together. The entire night he was very cuddley and emotional. I didn't expect anything to come from this tho, ie. getting back together. We talked here and there for a couple weeks after, then I saw him at the gym and he didn't bother to talk to me. We haven't spoken since. Was I just used for sex?

Please no judgemental answers. I know how stupid and oblivious I seem.

Any advice on how to go about this situation would be appreciated.