I am getting this really annoying error and I have no idea how to fix it. Hope you can help
error CS0120: An object reference is required to access non static member 'Unity.AudioSource.volume'
This is my script
using UnityEngine;
using System.Collections;
public class volumechange : MonoBehaviour
{
public static int volume;
public AudioSource;
// Update is called once per frame
void Update () {
if (volume == 1)
AudioSource.volume = 10;
if (volume == 0)
AudioSource.volume = 0;
}
}
↧