Show the "Game Over" text

Hi, I’m working Unity Tutorials, on lesson 5-3. I’ve finished step 3 (“3.Create GameOver function”), but I’m not sure how to make “Game over” show up when useful objects start to fall and hit the bottom of the scene. I searched all over, but I couldn’t find the problem.

Any assistance would be greatly appreciated.

well one thing is to have trigger at the bottom of the screen so when it goes to the bottom it triggers some code, and lose a life, and when there are no lives left, activate a text game object and kill all previously and stop the spawning of more

Thank you @bugfinders, this is a screenshot when a good object hit the sensor at the bottom, but ‘Game Over’ didn’t pop up as it should.

ok so what code did you have to make it show?

I created two Scripts, (GameManager & Target).

Target Script:
private void onTriggerEnter(Collider other)
{
Destroy(gameObject);
if (!gameObject.CompareTag(“Bad”))
{
gameManager.GameOver();
}
}

When I create GameManager.cs as instructed in Unit 5 Tutorial Create with Code, the gear icon does not show up. Will this have an impact?

the gear symbol i think has gone… it used to happen i havent seen it for a few versions… although Im on unity 6

So the first thing you need to do is confirm that code runs… eg, you put a debug.log message in
You also need to check the items you spawn have a tag of Bad
Check that script is on the bar at the bottom.

I appreciate your assistance, @bugfinders. Everything worked after I redrew everything. I believe that in the Hierarchy window, I right-clicked on an empty space rather than the Canvas element when I created a new UI > Text - TextMeshPro object and renamed it “Game Over Text.”