Years ago I solved it by performing traces from the camera towards the character. Anything it collided with in between the camera and player of a certain type “tree” I assigned a dynamic material… or changed a parameter on… something like that. basically you temporarily assign an opacity value or even an entire material. I don’t think I still have that old project. There might be better ways.
If you use post processing you could overlay your characters on top of everything else using a custom depth value.
The same custom depth mechanism can be used to create a lens of which you see things through with a custom depth only if you look through it.
That’s 3 ways I can think of, might still be better ways