My camera follows my player (3rd person view) at a distance, so when objects are in between both, I'd like to hide them (or reduce transparency).
My first attempt was to use a raycast that originates in the camera and targets the player, and get its collisions.
The problem with this is that it only returns one collision at a time. I then add that object to the raycast exception list so that he gets the next one. So far so good.
The bigger problem is that with this method I have no way to know if the objects in the exception list are still colliding with the raycast or not, so that I could show them again when the player moves out of that place.
I tried setting up a timer to remove all exceptions and get all collisions, but then I get flickers :(
Any ideas on how to go about doing this?
thanks in advance!