Search Unity

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

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice

Lerpz - Punch Sound problem

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

  1. Lourdman

    Lourdman

    Joined:
    Nov 3, 2010
    Posts:
    35
    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

    Joined:
    Jan 21, 2010
    Posts:
    26
    Yeah, same problem here.
     
  3. mrblurgle

    mrblurgle

    Joined:
    Jul 20, 2012
    Posts:
    1
    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 - http://forum.unity3d.com/threads/127149-Can-t-get-punch-sound-to-work-on-Lerpz
     
    Last edited: Aug 4, 2012
  4. stimarco

    stimarco

    Joined:
    Oct 17, 2007
    Posts:
    721
    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.
     
unityunity