Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Lerpz - Punch Sound problem

Discussion in 'Editor & General Support' started by Lourdman, Nov 10, 2010.

  1. Lourdman


    Nov 3, 2010
    Hi Everyone,

    As newbie, i do the Lerpz Tutorial.

    I'm trying to add a punch sound on Lerpz but it doesn't work. I'm pretty sure the problem comes from "audio.PlayOneShot" because i deleted the «if condition», just to check.

    Do you have any answer ?

    NB : i'm using Unity 3 on PC.
    NB2 : it's on the page 91 of the platform tutorial.
  2. Nemesis CGI

    Nemesis CGI

    Jan 21, 2010
    Yeah, same problem here.
  3. mrblurgle


    Jul 20, 2012
    I had a similar issue under 3.5.x.

    I found that if I clicked on the audio sample in the Project menu and set its 3d Sound checkbox to unchecked I could hear it slightly less faintly then before. However turning the Sound Volume up for the Pickup (Script) barely made a difference - I may need to adjust this in the JavaScript.

    I suspect the answer may be here -
    Last edited: Aug 4, 2012
  4. stimarco


    Oct 17, 2007
    I wrote this tutorial way back in 2007/08 for Unity 2.0. At this time, there was no 3D audio support, so the tutorial doesn't mention it.

    The audio features in Unity changed quite a bit in Unity 3—there's a completely different audio engine under the hood, based on the FMOD system. The upshot of which is that you'll need to tweak the settings quite a bit to get the sounds working correctly.

    The "fix" code in the thread linked to by mrblurgle above simply tells Unity to play the audio clip at the player's location. (Hence the "transform.position" bit, which simply passes in the location of the Player—i.e. "Lerpz"—to the AudioClip player.)

    My recommended fix is to ensure the "3D audio" features are switched off and ensure the sound effects are always imported as mono samples, not stereo. I created these sounds myself and they were never intended to be played as stereo sounds. If you try to play one-shot stereo sounds as 3D audio sounds, you'll get some very odd results.