How to make event when actor exits player view.

Hi, I was making a game where you have to doge a sphere zig zaging across the screen. I would like to make an event so when the sphere exits the player’s view, it will change direction and go back into view. How would I make that event? I know there is an event called “OnEndViewTarget,” but I have know Idea how this works.