0
\$\begingroup\$

I have a quastion about loading screen in unity. I don't want to make a scene between to levels [Main Menu > Loading Scene > Game level]. I want to use Canvas "Image"that run at the start of the game level and then disappear after few seconds [Main Menu > Game level]. Is this good idea ?

\$\endgroup\$

closed as unclear what you're asking by Stephane Hockenhull, Kromster, MrCranky, Seth Battin, Nate Aug 17 '16 at 19:27

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ what do you do in Loading Scene? \$\endgroup\$ – Sourav Paul Aug 12 '16 at 3:18
  • \$\begingroup\$ A Loading screen or scene is a scene use to give time for game level to be loaded. [gamasutra.com/blogs/SarahHerzog/20151125/260053/… \$\endgroup\$ – user43474 Aug 12 '16 at 3:32
  • \$\begingroup\$ Yes, this could be a good idea. Is that your question? \$\endgroup\$ – Kromster Aug 12 '16 at 5:05
1
\$\begingroup\$

If I understand correctly, you just want a Main Menu canvas to exist in your level and disable/destroy it when you're done with it. So just do exactly that in the OnClick handler of your button(s).

public void OnClick()
{
    gameObject.SetActive(false);
}

Have the above in a script attached to your menu canvas' object and select it as the method to call for your button's OnClick.

Now, if you want this to happen automatically after, say, 5 seconds...

float delay = 5f;
float timer = 0f;
private void Update()
{
    timer += Time.deltaTime;
    if (timer >= delay)
    {
        gameObject.SetActive(false);
    }
}

There are much better and more concise ways to handle delayed actions like this, but this should demonstrate things adequately.

\$\endgroup\$
  • \$\begingroup\$ Probably the most simple way you will find to do it, i actually like this method allot. +1 for you! I was trying to think of the most complex way, that actually causes objects to load in stages to allow for everything to load properly, but this works way better haha. \$\endgroup\$ – Ryan white Aug 12 '16 at 7:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.