Make Object Disappear when no longer in frame

I want to start a game off by having a certain object in sight, i.e. a cube, and when the first person player looks away, the object is moved somewhere else in the map, is this possible and how would I do it?

Look at OnBecameInvisible, Raycast and transform.position