Why would a guy avoid you now that he’s in a relationship?

This guy showed a lot of attraction towards me but we aren’t allowed to date bc of rules.. but we’re not friends, I don’t have his number or anything.. why is he kind of avoiding me if nothing ever happened between us…

it’s nice that he’s talking to someone but I don’t understand why it has to be weird. I didn’t even react to him before

Updates
+1 y
The reason I can’t date him is bc he’s my professor for a art class. We are close in age
Why would a guy avoid you now that he’s in a relationship?
Post Opinion