I'm getting an error CS1041: Identifier expected for my script?
So I'm following this person's script for AudioFadeOut: https://forum.unity3d.com/threads/fade-out-audio-source.335031/ and I'm going through and fixing the errors that pop up but one has me stumped.
Assets/Scripts/AudioFadeOut.cs(6,44): error CS1041: Identifier expected
This is what my current script looks like:
using UnityEngine;
using System.Collections;
public static class AudioFadeOut : MonoBehaviour {
public static IEnumerator FadeOut (AudioSource, float FadeTime) {
float startVolume = AudioSource.volume;
while (AudioSource.volume > 0){
AudioSource.volume -= startVolume * Time.deltaTime / FadeTime;
yield return null;
}
AudioSource.Stop ();
AudioSource.volume = startVolume;
}
}
Now I know that there's something wrong with line 6 that's causing this error but no matter what I try, this one is very stubborn. Can a pro point out where I've gone wrong or what I've missed here? I would greatly appreciate any and all help :)
Your answer
Follow this Question
Related Questions
can't get sound to fade out, only to fade in 1 Answer
Help to play music whenever the character enters a GameObject... 1 Answer
Second AudioClip won't play 0 Answers
How to make an editor extension to unity ui for switching audio clips? 0 Answers
AudioSource.Play plays every sound at once,AudioSource.Play Plays every source at once 0 Answers