I have a scene with a 3rd person character where the camera floats behind the player. When the player walks through the world, I have sprites appear over objects that the player can interact with.
I have three cameras in the scene: 1 orthographic camera for the GUI, and 2 perspective cameras (one for the game, and another camera that only renders the 3d sprites) The game cam has the lowest depth, followed by the 3d GUI Cam, and then the orthographic GUI Cam on top.
The problem I'm running into is that I don't want to see the selector sprites through the Player character. I want them to appear through other objects, just not the player.
Currently I have it set up where the sprites are toggling themselves on or off by linecasting to the camera and then checking if it hit the player collider. It works for the most part but i'm sure there has to be a better way of doing it? A shader perhaps? I'm still very much a shader newbie so I have no idea...