title: An object reference is required to access a non-static member
body: <p>I'm having this error come up and I'm not sure why... I've tried to look it up, people are saying to create an object of the class or create the methods as static... but I'm unsure how.</p>
  
  <p>Here's my code below:</p>
  
  <pre><code>public class SoundManager : MonoBehaviour {
  
  public List&lt;AudioSource&gt; audioSounds = new List&lt;AudioSource&gt;();
  public double minTime = 0.5;
  
  public static void playSound(AudioClip sourceSound, Vector3 objectPosition, int volume, float audioPitch, int dopplerLevel)
  {
      bool playsound = false;
      foreach (AudioSource sound in audioSounds) // Loop through List with foreach
      {
          if (sourceSound.name != sound.name &amp;&amp; sound.time &lt;= minTime)
          {
              playsound = true;
          }
      }
  
      if(playsound) {
          AudioSource.PlayClipAtPoint(sourceSound, objectPosition);
      }
  }
  }
  </code></pre>