Search Unity

Semi-transparent mesh

Discussion in 'Editor & General Support' started by adshead, Aug 15, 2005.

  1. adshead

    adshead

    Joined:
    Jul 19, 2005
    Posts:
    74
    What's the easiest way to make an object semi-transparent in Unity? I have an object that can sometimes go inside other objects and when it does I want to make the outer objects semi-transparent so that I can see the inner object. Is this possible?
     
  2. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    You need to make the object(s) you want to become transparent have one of the alpha shaders, then you can control its transparency by setting the alpha value of the material's color property.

    You don't want to make all objects use the alpha, on the off chance that something could go inside it. What I would do would be to make a small script you attach to the moving object. When this object hits something, it would change the shader of the material of the object it hit to alpha/Diffuse (or whatever), and then change back again once it was no longer neccessary.
     
  3. Richard_B

    Richard_B

    Joined:
    Jul 22, 2005
    Posts:
    436
  4. adshead

    adshead

    Joined:
    Jul 19, 2005
    Posts:
    74
    Thanks for the pointers!