Search Unity

Unity 5.2.0f no sound function AudioSource.PlayClipAtPoint ????

Discussion in 'Audio & Video' started by Irina-uk, Sep 11, 2015.

  1. Irina-uk

    Irina-uk

    Joined:
    Feb 14, 2014
    Posts:
    62
    She worked on the 5.1 sound has been using the AudioSource.PlayClipAtPoint, today moved to the 5.2 sound is missing? Tell me again where you can download 5.1 or how to fix it
     
  2. Irina-uk

    Irina-uk

    Joined:
    Feb 14, 2014
    Posts:
    62
    Fix it, now you need to play 2D sound position of the camera, so that the sound of the volume, which is in reality.
     
    retxab, dougbello and Ernestosaurio like this.
  3. Irina-uk

    Irina-uk

    Joined:
    Feb 14, 2014
    Posts:
    62
    Camera.main.transform.position
     
    Last edited: Sep 11, 2015
    Bruno85, uistudios and Ericthegreat like this.
  4. Ernestosaurio

    Ernestosaurio

    Joined:
    Jul 9, 2015
    Posts:
    6
    Thanks for the fix Irina uk. In my current project some sounds using AudioSource.PlayClipAtPoint sounded very low, then I realized that one shoot audio gameobjects now have the Spatial Blend set to 3D.
     
    Last edited: Sep 12, 2015
  5. Ericthegreat

    Ericthegreat

    Joined:
    Feb 14, 2014
    Posts:
    2
    Thank you very much for those wondering you do it like this:
    AudioSource.PlayClipAtPoint(coin, Camera.main.transform.position);
     
    Stoyan377 likes this.
  6. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
    That doesn't work correctly (with correct I mean same as earlier 2D audio) if camera moves after sound has started to play.
     
  7. kristianbauer

    kristianbauer

    Joined:
    Feb 16, 2015
    Posts:
    1
    I found another way to resolve this. Edit -> Project Settings -> Audio. Set Volume Rolloff Scale and Doppler Factor to 0.
     
  8. Nifflas

    Nifflas

    Joined:
    Jun 13, 2013
    Posts:
    118
    I don't think you should use AudioSource.PlayClipAtPoint, this feature should be deprecated as it lacks an argument for a template AudioSource, making the rolloff curves non-customizable and completely arbitrary (which things should never be in a development tool). The easiest solution is if you just set up your own static method replicates the functionality, but lets you pass an actual template AudioSource as an argument, or alternatively references one or multiple templates through a singleton manager. It takes beginner-immediate-ish programming skills, but you'll be happy you did if you realize you need to adjust the spatial blend, or change the rolloff.
     
  9. cansit

    cansit

    Joined:
    Oct 30, 2013
    Posts:
    1
  10. Stoyan377

    Stoyan377

    Joined:
    Apr 2, 2016
    Posts:
    1
    Thanks a lot! It really works!
     
  11. uistudios

    uistudios

    Joined:
    Apr 6, 2009
    Posts:
    46
    yay! thank you... this was driving me crazy for hours.... the sound was soooo quite until i used the camera position.