I made a script to change volume but i get error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement Can you help me fix it? This is the script: Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Audio; public class SettingsMenu : MonoBehaviour { public AudioMixer audioMixer; public void SetVolume(float volume) { audioMixer.SetFloat; ("volume", volume); } }
Spelling and punctuation are critical in programming. It appears you hand-typed this code in, and at a minimum there is an extra semicolon between the SetFloat function name and the open parenthesis.