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

Getting error CS106

$
0
0
I was following a tutorial on making an AudioManager and my code won't work. Can anyone find the problem, please? using UnityEngine.Audio; using UnityEngine; using System; public class AudioManager : MonoBehaviour { public Sound[] sounds; //is called for before everything starts void Awake() { foreach (Sound s in sounds) { s.source = gameObject.AddComponent(); s.source.clip = s.clip; s.source.volume = s.volume; s.source.pitch = s.pitch; } } public void play(string name) { Sound s = Array.Find(sounds, sound => sound.name ==name); s.source.Play(); } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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