On the camera, use a Physics.LinecastAll that goes from the camera to the character's center to check if there are obstacles between. Make sure to use a LayerMask that includes the fadable objects but exclude the player.
On all the hits, use TryGetComponent<FadeFrontPlayer> and call the function
June 13, 2025 at 2:09 PM
On the camera, use a Physics.LinecastAll that goes from the camera to the character's center to check if there are obstacles between. Make sure to use a LayerMask that includes the fadable objects but exclude the player.
On all the hits, use TryGetComponent<FadeFrontPlayer> and call the function
Put a "FadeFrontPlayer" script on each object that need to fade. In that script, add a function to toggle on/off fade and in the update method, slowly lower or increase the alpha of the color of the material of the renderer (the material must use the Transparent setting instead of Opaque).
June 13, 2025 at 2:00 PM
Put a "FadeFrontPlayer" script on each object that need to fade. In that script, add a function to toggle on/off fade and in the update method, slowly lower or increase the alpha of the color of the material of the renderer (the material must use the Transparent setting instead of Opaque).