"Game Over" scene not loading

When my ball passes through lose collider, Game Over scene is not loading.I have added all my scenes into build settings.I’ll be pleased if get my answer of my error.Thank you.

Hi Yawer,

Are there any error messages in your console? Did you try to add a Debug.Log to the method that is supposed to load the Game Over scene?

No there are no error messages in my console and I have added Debug.Log to the method but still it is not loading game over scene.

Where exactly did you add the Debug.Log? Does the message appear in your console? If the method or the code block with the Debug.Log does not get executed, check where the method was supposed to be called and/or check the if-condition.

Is the “Game Over” scene in your Build Settings list?

I had added Debug.Log before SceneManager.LoadScene.

Does the message appear in your console? If not, go to the method that was supposed to call the method with your Debug.Log in it and add another Debug.Log.

As you can see in this video,I had done everything but still don’t know where is the problem.

The ball seems to be very fast. Please try to make it slower.

I had made my ball slower also but still not working😔

I’ve watched the video again. There is a typo in your OnTriggerEnter2D method.

Next time, it would be great if you could post the code as text because it’s fairly difficult to read code in videos or on screenshots.

Aaaaman

Please note, it’s better to copy/paste your code and apply the code fencing characters, rather than using screenshots. Screenshots are ideal for displaying specific details from within a game engine editor or even error messages, but for code, they tend to be less readable, especially on mobile devices which can require extensive zooming and scrolling.

You also prevent those that may offer to help you the ability to copy/paste part of your code back to you with suggestions and/or corrections, meaning that they would need to type a potentially lengthy response. You will often find that people are more likely to respond to your questions if you make it as easy as possible for them to do so.

Have you already compared your code to the Lecture Project Changes which can be found in the Resources of this lecture?


See also;

Its a capital O for OnTriggerEnter2D.

Please mark the solution as solved and review the previous sections on naming of methods :slight_smile:

(SOLVED):grin::grin: oh thanks after a very long time it has solved.I hadn’t wrote capital O for OnTrigger.Thanks once again.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms