Hi everyone,
I’m new to Unity and currently building a simple project to test audio spatialization in VR.
I built a level with a chessboard-like floor. There are audio sources in some squares of the floor. It should be possible to click on a separate square of the floor (or activate by look) and get certain amount of point depending on how close the player is to the true audio source.
Please guide me if you know any helpful links.
Ray cast from mouse or screen center. Get audio source component from returned object then check Vector3.Distance(myPosition, squarePosition).
Using the new UI system that was added in Unity 4.6 you could set up a grid of button using the onclick method that they have to fire a function with its coords. In your script have set locations of the audio cues , based on distance like above you can then change the volume of the audio based non how far the distance is away from the click.