printing to the screen if an object is too close