Trying to toggle visibility off when raycast is no longer hitting the object

I mean the branch in screenshot-1.png