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

Forgive my ignorance, but you’re talking about for the line trace correct? I tried creating another function in my player interface and wasn’t really sure how to connect it or if I was even on the right track.