Cylinder mask material from camera to character

I am trying to set up a material with an opacity mask that acts like a cylinder from the camera to the character. I am using a line trace to detect collision from the camera to the material. I have implemented it successfully with a spheremask that sets the location of the sphere to hit location. This doesn’t play well though. I am trying to hide walls that make it hard for the player to see around and navigate in a tight enclosure. How can I manipulate the spheremask to work as a cylinder with ends at the camera and character locations? Or can I use some other technique to achieve this?

there’s a method that uses the sphere mask. Shown around the 10 min mark of this vid.


you could also try the drawline 3d node.