While it may come across like a sloth that looks like they're giving a hug, it has nothing to do with affection. The way that sloths hold on to trees and their mothers in the wild is by holding on in that fashion. When they are held or dangle for long periods from their arms, they experience discomfort.