Search Unity

Question I need some help deleting old audio script for the microkart fmod tutorial please :'(

Discussion in 'Getting Started' started by dekkereq, Jan 22, 2022.

  1. dekkereq

    dekkereq

    Joined:
    Jan 22, 2022
    Posts:
    7
    I'm a super noob. I'm doing the Microkarting FMOD tutorial (fmod integration tutorial), and I'm still in the middle of deleting the old audio script from the game.

    I have a few questions please.

    1. In section 3.2.9 of the FMOD integration turotial - Delete all the lines that contain m_audioSource from FeedbackFlashHUD.cs.

    I have attached a screenshot, pointing out 1. and 2. questions. Please look to see what im referring to.

    Here is a line I have deleted, which contained m_audioSource, and there is a yellow line on the left. Is that signifying an error? Have I deleted that line properly?

    2. Here, there is only one line ( m_audioSource.PlayOneShot(warningAudioClip) containing m_audioSource, but other lines surrounding it. Is it ONLY that one line I delete, or do I delete the lines above and below?
    If i change it from:

    if(!warningSoundPlayed && vignetteCanvasGroup.alpha >= 0.5f){
    m_audioSource.PlayOneShot(warningAudioClip);
    warningSoundPlayed = true;

    to:

    if(!warningSoundPlayed && vignetteCanvasGroup.alpha >= 0.5f){
    warningSoundPlayed = true;

    is that correct? In the tutorial it only says “Delete the LINES with m_audioSource in them”

    ---------------------------------------------------------------------------------------------------------------

    3. What does it mean to "delete a call"?

    In the Karting tutorial, it says to delete all calls to “playsound”

    What exactly does this mean?

    Here is the script containing “playsound”

    What do I delete? All of it?

    void PlaySound(AudioClip sound)
    {
    if (!sound)
    return;

    if (!m_AudioSource)
    {
    m_AudioSource = gameObject.AddComponent<AudioSource>();
    m_AudioSource.outputAudioMixerGroup = AudioUtility.GetAudioGroup(AudioUtility.AudioGroups.HUDObjective);
    }

    m_AudioSource.PlayOneShot(sound);
    }

    Thanks so much for your help
     

    Attached Files:

    • fmod.png
      fmod.png
      File size:
      142.2 KB
      Views:
      251
  2. Valjuin

    Valjuin

    Joined:
    May 22, 2019
    Posts:
    481
    1. The yellow line on the left indicates that you have made a change but not saved the script. You have deleted that line correctly.

    (The AudioSource variable, m_audioSource, was added on line 25 and should also be deleted, if you haven’t already done so.)

    2. Just delete the one line: m_audioSource.PlayOneShot(warningAudioClip);

    3. In the ObjectiveToast script, there are calls to PlaySound on lines 87 and 117, as follows:

    Line 87: PlaySound(completedSound);
    Line 117: PlaySound(initSound);

    Delete these two lines.