Why do girls sometimes only talk to a certain guy when the guy is alone?

I've noticed this with a girl I like. If I'm alone the girl I like will talk to me more. Otherwise if I'm with someone she barely says anything to me
Why do girls sometimes only talk to a certain guy when the guy is alone?
Post Opinion