Code:

var clipping_range; // Range to clip
var use_smoothing; // 1 To use transparence, otherwise 0

action clipped_ent
{

my.transparent=on;
my.alpha=100;

wait(random(5));

while(me)
{
if(use_smoothing)
{
if(vec_dist(my.x,camera.x)>clipping_range)
{
my.alpha-=2.5;
}
else
{
my.alpha+=2.5;
}
my.alpha=clamp(my.alpha,0,100);
}
else
{
if(vec_dist(my.x,camera.x)>clipping_range)
{
my.invisible=on;
}
else
{
my.invisible=off;
}
}

wait(4);
}
}



np