Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Audio played speeded up until player dies

Discussion in 'Audio & Video' started by matazematratze, May 3, 2015.

  1. matazematratze

    matazematratze

    Joined:
    May 3, 2015
    Posts:
    9
    hi everyone!
    im working on a.. racer i guess. the player object is being moved forward through the level constantly by the game controller, while the players job is to use wasd to dodge falling objects.
    now ive got this issue with the audio clip in my scene. its attached to the player object (as the distance between player object and camera is the only constant distance in the scene) while the listener is left as default (attached to main camera). now, it does play the clip, that much is fine. but its speeded up like 50%. interesting enough this is fixed right after the player dies (controlls disabled, world still acting like before only the player object stops moving). i get the exact same results using either no script at all (ticked 'play on awake' in the inspector), using a script with .Play() (with unticked 'play on awake') or using a script with .PlayOneShot() (also of course with 'play on awake' unticked).

    anyone any idea?

    (i find it really peculiar that this is fixed by player death, as it really only changes like one bool which prevents the controlls to do anything anymore but instead enables restarting the game by pressing R)
     
  2. aihodge

    aihodge

    Joined:
    Nov 23, 2014
    Posts:
    163
    Try adjusting the 3D Sound Settings on the AudioSource attached to the player object - I'd start with the Doppler setting.
     
  3. matazematratze

    matazematratze

    Joined:
    May 3, 2015
    Posts:
    9
    praise school and education! problem solved..
    i looked into 3d audio settings and noticed 'Doppler'.. so i set it to 0.. as easy as that
     
    aihodge likes this.
  4. matazematratze

    matazematratze

    Joined:
    May 3, 2015
    Posts:
    9
    haha u were even faster. and right. thanks dude.