I want to play a sound when the main camera “sees” an object, like a cube or something different.
Thanks
I think you could use OnBecameVisible():
Note, the OnBecameVisible event script must be in the exact layer of the prefab that holds the renderer. Or it won’t fire. Also, if you don’t “maximize on play”, Unity will consider the prefab visible if it’s visible on the Game view or Scene view. So Either use maximize on play or zoom way in on scene view so you’re not seeing more than the game camera.