title: Audio not playing in Unity
body: <p>I am trying to program a script that when you hit an enemy it plays a sound, problem is I can't get it to play the sound it sees the audio source but my script won't pass the clip to it.</p>
  
  <p>Here is the code I currently have:</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.Audio;
  
  public class makeanoise : MonoBehaviour
  {
      public AudioClip hurtSound;
      public AudioSource soundSource;
  
      private void Update()
      {
  
          if (!soundSource.isPlaying)
          {
              soundSource.clip = hurtSound;
              soundSource.Play();
          }
      }
  }
  </code></pre>
  
  <p>how do you get the audio source to play the sound? because not even my team mates know to do it</p>