Is there another way to hide an object

Before I describe my problem let me say that I have a solution but it’s not exactly what I am trying to achieve.So,I’m building an isometric game and I need to hide a couple of walls that stop me from seeing my character.I don’t know how to do it for only one object at a time ,since they share the same material,in a gradual way.I can hide them by linecasting from the camera to the player every third of a second and disabling the mesh renderer,and it works but it’s not very nice looking since the walls just pop out and then in back into existence.So if anyone knows a better way to do it,like hiding gradually,only the object that interfere’s with my line of sight,or can point me in the right direction I would very much appreciate it.Thanks

How about having 2 materials?

  1. the normal one that you are using for your walls,
  2. a material that is the same as the first one, but would get used when you are trying to fade out.

Then when you want to make a part of the wall disapear, asign the second material to it and fade it out.

Would go like this when you wanted to fade out a wall.

  • Asign 2. material to this part of the wall
  • Fade out the 2. material

and when your fading back in, when the alpha reaches max(normal), reasign the first material, so they dont fade out when your fading a new piece of the wall.

Have you ever considered lowering the walls opacity?