Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

object reference problem

$
0
0
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; } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>