Finish Line
Part of the Building Real Games section of Coddy's Unity journey. Lesson 55 of 60.
Challenge
MediumMake the white gate finish the level and open the next one.
- In
FinishLine, addusing UnityEngine.SceneManagement;andOnTriggerEnterthat returns unless the object has aPlayer. - Log the level's name and
complete!, asLevel1 complete!. - Load the build index after the active scene's; after the last level, load index
0.
Press Play and cross the finish: Level2 opens. Then Check.
Try it yourself
using UnityEngine;
public class FinishLine : MonoBehaviour
{
// A later lesson fills this in: the end of the level.
}
All lessons in Building Real Games
10Project: 3D Platformer
The CourseMoving Platforms2Buttons and Screens
Buttons and onClickLambdasWiring in the InspectorPanels On and OffHealth BarsRecap: Upgrade Shop5Saving with PlayerPrefs
Save a NumberLoad with a DefaultHigh ScoreSave SettingsRecap: Coins in the Bank3The Game Manager
One Script Runs the GameThe SingletonGame StatesSwitching on the StateRecap: Round Manager6Project: Endless Runner
Three LanesObstacles Ahead9The New Input System
Two Input SystemsKeyboard and MousePressed This FrameInput ActionsRecap: Input SwapPractice on your own: Unity playground