Collect item game goes on to next level

Ok im using c# and i want to know how i would make it so when collect enough items it stops game brings up a text saying Great job or something and then it goes straight into the next level/scene im fairley new to c# but i understand some coding

Thank you

Well, there are a few different approaches you can try.

If you want to “stop”, or better called pause, your game you should use the timescale variable in the Time class. The UI is unaffected by that, so your UI will still run perfectly fine.

In terms of the text, you should consider creating an UI Canvas with a text element. Store the text component in an appropriate variable of the type Text. Then just set the Text.text value as you want. If you want to hide your Text, just disable the Gameobject with the IsActive() function, provided for every gameobject.

If you want to switch to another level (scene in Unity), you have to get familiar with the SceneManager. The needed function is : SceneManager.LoadScene();