hi. I am probably a dummy but I keep getting this error and I am unable to fix it. I am working on a settings menu with player prefs using this code plz help
using System;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.SceneManagement;
using TMPro;
using UnityEngine.UI;
public class SettingsMenu : MonoBehaviour
{
[Header("Credits")]
public int CreditsScene = 0;//when you want to play the credits open this scene
[Header("Audio")]
public AudioMixer AudioMixer;//this is for ajusting the volume of tracks on the audio mixer
[Header("FPS Cap")]
public Toggle VSync;//turn vscync on or off
public TMP_InputField MaxFPS;//this is the max fps you can get
private int FPS;//the fps cap
[Header("Fps Monitor")]
public GameObject FPSMonitor;//desplays the fps you are currently geting
public Toggle FpsMonitorToggle;//will turn the fps monitor on or off
[Header("Menu switching")]
public GameObject SecondMenu;
public GameObject FirstMenu;
void Save()
{
PlayerPrefs.Save();
}
void Load()
{
//Audio Mixter Settings
AudioMixer.SetFloat("Main", PlayerPrefs.GetFloat("Main", 0));
AudioMixer.SetFloat("SFX", PlayerPrefs.GetFloat("SFXVol", 0));
AudioMixer.SetFloat("VOICEVol", PlayerPrefs.GetFloat("VOICEVol", 0));
FPS = PlayerPrefs.SetInt("FPSVal", PlayerPrefs.GetInt("FPSVal", Screen.currentResolution.refreshRate));
}
void Delete()
{
PlayerPrefs.DeleteAll();
Load();
}
}
it seems to have something to do with this line: FPS = PlayerPrefs.SetInt("FPSVal", PlayerPrefs.GetInt("FPSVal", Screen.currentResolution.refreshRate));
error: Assets\Scripts\Menu\SettingsMenu.cs(41,15): error CS0029: Cannot implicitly convert type 'void' to 'int'