I have a game I'm working on where I want to do object highlighting. Right now I'm using areas to detect when the player enters and leaves and using a shader to highlight an outline around the character. This works reasonably, but I have to attach a script to every one of the objects I want highlighting on to make it work.
Is there a more efficient way to do this that doesn't require me to set up every single object with a next_pass shader material? Ideally I would just highlight stuff when the player is looking in their direction and close enough, so probably still need an area. But I have yet to figure out how to switch out materials, and I don't even know if that's efficient. Any ideas would be super appreciated. Thanks for your time.