I am trying to control the volume of the first audiosource in an array with a slider. The problem is that it's telling me there is no definition for 'volume' in audiosources[0].volume. The script is in an AudioManager from a tutorial from Brackeys: Tutorial.
//Volumeslider
public void VolumeSlider(float newVolume)
{
Component[] audiosources;
audiosources = GetComponents(typeof(AudioSource));
audiosources[0].volume = newVolume;
The error: 'Component' does not contain a definition for 'volume' and no accessible extension method 'volume' accepting a first argument of type 'Component' could be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp]csharp(CS1061)
This is my first question.