I'll be fighting some rando mob with an axe/sword, probably in a swamp, and I can't perform a melee combo because a tree is detected within the swing. It'll instead just do a single chop like I'm cutting the tree down, so you're stuck doing these pitiful swings with large intervals between. I've died many times in the swamp because I thought I was going to combo a dude to death, instead doing a longer tree swing and getting murked midswing.
Would be cool if swing type was based on camera direction: possibly incorporate a dot product between camera XY forward vector and an XY vector from the player to the detected mob, both normalized. Values close to 1 would indicate that the player wants to swing at the mob instead of the tree since they're looking right at the mob.
Mobs are already detected by the camera, so no need for extra functionality on that end.
However this could be intentional so we don't kite mobs around trees to cut them down faster, but damage to trees could be lowered when performing a melee combo to offset that.
Source: https://www.reddit.com/r/valheim/comments/pxpqc8/trees_hinder_combat_suggestion_for_fix/