PLEASE HELP FIX ERROR

Hello this is my current error but not sure how to fix it

Assets\SampleScenes\Menu\Scripts\SceneAndURLLoader.cs(19,15): error CS1061: ‘PauseMenu’ does not contain a definition for ‘MenuOff’ and no accessible extension method ‘MenuOff’ accepting a first argument of type ‘PauseMenu’ could be found (are you missing a using directive or an assembly reference?)

And here is my script i highlighted error in green

using System;
using UnityEngine;
using UnityEngine.SceneManagement;

public class SceneAndURLLoader : MonoBehaviour
{
private PauseMenu m_PauseMenu;

private void Awake ()
{
m_PauseMenu = GetComponentInChildren ();
}

public void SceneLoad(string sceneName)
{
//PauseMenu pauseMenu = (PauseMenu)FindObjectOfType(typeof(PauseMenu));
NewMethod();
SceneManager.LoadScene(sceneName);
}

private void NewMethod()
{
m_PauseMenu.MenuOff();
}

public void LoadURL(string url)
{
Application.OpenURL(url);
}
}

It just means there’s no such thing as “MenuOff()” in your PauseMenu class … or that it’s not public.

Oh okay I just realized how to fix it but thank you for your help

Try to use code tags so that code is more readable for others on the forum just than a pain-text copy pasta.

How to use code tags?

1 Like