Anything that blocks your line of sight will block the infrared beam as it’s a light based system, therefore you cannot shoot through trees. Leaves provide partial cover. The harder it is to see through the leaves, the more cover they provide. For players, often trees with thick trunks make the best cover.