Was this a good idea?

I had something with a guy and we both really liked each other but never said that we did but just acted like two people who liked each other. It was really great.

The other day I was starting to think that maybe I was wasting my time and maybe he didn’t like me like I liked him. Maybe he was just loving the attention but did not reciprocate the feelings

So I went and asked him if he liked me because I liked him and didn’t want to be led on. And he said he liked me but gave me some reasons why he didn’t want a gf. He needs to keep his grades up and he doesn’t want any distractions. He is also getting over a past relationship and is still hurt from it.

Now I feel like things won’t ever be the same between us. Did I make the right decision to ask him if he liked me?