ok,if can be metall,it will be good.especially something like iron,or magnetics metall.the you can use a LC resonant circuit.when the metall is neer the indutor coil,the value of inductor will be higher,so the frequence will be lower.if the ball is taken away ,the frequence will be higher.so ,use a demodulator can detect the change of frequence,so you will know the ball is near you or be taken away.this is one method.
method two:if the ball is too far away from the detector,method one maybe can not work.you can use a IR ,either use the reflect signal or the signal be cutted off by the ball,the you can get the change signal of IR,you can also know whether the ball is take away.
hope can be help.