People’s behavior change when they feel attracted towards other people because it’s a desire they have to gain the attention of the person who’s attracting them. In cases of such, it’s more of a matter of wanting to change the perception of one’s self in another person’s eyes to a kind of person they feel the attractive person would want.
When people see somebody they feel attracted to, it’s an instinct to try and draw closer to them and gain their attention.