That only happens if you let it. As long as you remember what you're raising them for, it's not a problem. Just don't confide in your pig all your problems, or let him sleep in the bed with you, and it'll work out.
My mom, the first year we had chickens, she'd named them all, and given them names to fit their characters, like the one that crowed a lot was Tom Jones ("'cause he's the singin'est!").
Come that first butchering day, Mom was very upset, but she still did the work of scalding and plucking, and I remember her working at the giant washtub sat over the fire, scalding the chickens, and every one that would go in, she'd cry and sniffle a little and say something like, "I'm sorry, Miss Lizzie!" and she swore never to name a food animal again.
Don't name your food animals!