Home > Back-end >  How i can make title screen?
How i can make title screen?

Time:05-16

I am trying to make title screen when i press a button. It goes when i press the button game stops with Time.timeScale = 0f; and i am tring to do is when i click button time stops and two buttons shows up for quit and resume and I am tryint to do when i press the button it sets show = true; in script for manu button. This work but when i type script for button "resume" witch is

 private void Awake()
{
    gameObject.SetActive(false);
}

private void Update()
{
    show();
}
private void show ()
{
    if (show = true)
    {
        gameObject.SetActive(true);
    }
      
        
}

But there is an error "Cannot assign to 'show' because it is a 'method group'". I don't know what this mean and how i can repair my code.

CodePudding user response:

it would be great if you made bool

here some example of your code

public bool show;

 private void Awake()
{
    gameObject.SetActive(false);
}

private void Start()
{
    show = false;
    gameObject.SetActive(false);
}
private void gameobject()
{
    if (show = true)
    {
        gameObject.SetActive(true);
    }
    else(show = false){
        gameobject.SetActive(false);
    }

      
        
}

Deleted show() and replaced update() with Start()

Useful information about bool

https://docs.unity3d.com/ScriptReference/30_search.html?q=bool source: unity documentary

  • Related