I'm not sure how to trigger an event based on whether an object is visible or not

Heres a guide with lots of advice and tips. Hope this helps!