Loadscene(0) won't reload the scene in case of finishline

Hi, i am currently on vid #38 on the Unity 2D course.

In the snow boarder game, I am trying to insert the restart level logic. I have written the code exactly as per the tutorial. The level restarts in case of crash but not when I cross the finish line. I have checked the code multiple times as well.
pls help


Have you set the scene in Unity?

yes I have. The head collision is working fine, not the finish line though

You made sure the collider is a trigger?
and checked it with this graph;

Is the FinishLine component attached to the player or the finish line? It should be attached to the finish line.

The collider is a trigger, and I am not sure how to read this graph.

I have attached it to the finish line. still not working

Hi,

It tells you when Unity will register a trigger/collision.
So: since we are sure one is a trigger already (red rectangle selection)
For a trigger to happen you need the other gameobject to have one of the things
in the orange rectangle selection where there is the word “trigger” in the red rectangle selection.

So for example, one needs a rigidbody if you have 2 trigger colliders or nothing will happen.

How are you getting on with this, @braga?

Privacy & Terms