Alpha issues...!

Hey, all,

I’ve asked questions surrounding this a few times now, but it’s really starting to cause me some issues, so can anyone actually shed any light on it?#

How do I affect object’s alpha?

This is causing me issues in the following situations -

  1. I’d like to use a GUI Texture as a full-screen fade. Plonk the GUI Texture in front of everything, and gradually make the texture more opaque, fading everything in the background to black.
  2. Fog transparency. Even though the fog has an alpha element to it, it seems to make no difference to the fog. I have a static background image behind my 3D images, and I’d like the 3D models to fade into the background - at the moment, I can only do it by chosing the best average colour from the background image, which ain’t ideal.
  3. “Line of Sight” - sometimes, there may be an item in the world which is very close to the camera. In console games (which I’ve written more than a few), we got around this occlusion problem by fading out entire objects which got in the way of the camera. Working out if they’re in the way isn’t a problem - working out how to make them change alpha is a real issue.

Help! I really feel like I’ve made a lot of progress with Unity recently, and I’m just about ready to submit my first app to Apple, but I NEED to sort out this alpha thing sharpish!

Thanks in advance for any info! :slight_smile:

for the gui texture have a look at the wiki:

hm… fading the rest out i am not sure, only way i would know would be fade out every single gameobject by using everygameobject.material.color.a

You can have a look at this, but it would have to be updated for Unity 2.x and isn’t going to work on the iPhone in any case.

–Eric