- Home /
Third Person Camera Wall Covering Camera
Like what the title said, I made a third person controller with a third person camera. Sometimes the camera will be covered by a wall, which is troubling.
I thought about making the wall either semi-transparent or completely transparent when colliding with the camera with raycast or have a small trigger collider that will switch on a bool in the wall's script to change the material opacity.
HOWEVER, I am using this for a local multiplayer game, so I can't have everyone seeing the wall being transparent. Essentially I want to player with a camera that is covered by a wall to see a transparent wall, while other players still sees a non-transparent wall. Any ideas? Please avoid shader coding, I have no idea how to do those :l
How does your game work for local multiplayer? I'm assu$$anonymous$$g its split screen with each user having their own view of the game world?
You can use OnPreRender and OnPostRender to change an object's layer to one that is not rendered by the camera in question temporarily.
Aside from that, you can also cast four rays back towards the camera's viewport corners and if they hit something, pull the camera closer to the player object.
Your answer
![](https://koobas.hobune.stream/wayback/20220612043614im_/https://answers.unity.com/themes/thub/images/avi.jpg)