- Home /
The left-hand side of an assignment must be a variable, a property or an indexer
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement;
public class PauseMenu : MonoBehaviour {
public GameObject pausePanel, pauseButton;
// Update is called once per frame
void Update () {
}
public void onPause ()
{
Time.timeScale = 0;
pausePanel.SetActive = true;
}
} so i am making a pause menu and timescale thingy works perfectly but when i set the panel active, it shows me the error. Please help,using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement;
public class PauseMenu : MonoBehaviour {
public GameObject pausePanel, pauseButton;
// Update is called once per frame
void Update () {
}
public void onPause ()
{
Time.timeScale = 0;
pausePanel.SetActive = true;
}
} When i type pausepanel.setactive = true; it shows the error: The left-hand side of an assignment must be a variable, a property or an indexer
Help please
Answer by Firas4d · May 07, 2018 at 11:46 AM
That means you can't assign a value to a method. SetActive is a method, please refer to the Unity Scripting API before posting here.
Your answer