This code came to me as a simple distance-based switch for the INVISIBLE flag, but has become an effect that gets comments from everyone who sees it. This community and especially George with AUM, and Ventilator, and whoever wrote the MDL5 Maya exporter, has saved me SO MUCH TIME AND WORK, that this is the first of what I hope will be many contributions from me.

action smart_walls
{
while (1)
{
if (vec_dist (my.x, camera.x) < 220) // play with this value
{
if (my.TRANSLUCENT == OFF)
{

my.TRANSLUCENT = ON;
my.alpha = 100;
while (my.alpha > 20)
{
my.alpha -= 10 * time;
wait(1);
}
}
}
else
{
if (my.TRANSLUCENT == ON)
{
while (my.alpha < 100)
{
my.alpha += 10 * time;
wait(1);
}
my.TRANSLUCENT = OFF;
}
}
wait (1);
}
}