i guess your code is a bit..unfine

u should make it in a while(1)
so it dont stop( in opposite to your code) and can check it every frame new...btw:it is not good to trace: if there are 2 objects ore morejust one object will be transparent