# Loading the next level

**URL:** <https://discussions.unity.com/t/loading-the-next-level/430212>\
**Category:** Scripting\
**Tags:** Scripting\
**Created:** [December 5, 2010, 2:26am UTC](https://discussions.unity.com/t/loading-the-next-level/430212 "2010-12-05T02:26:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon\_14676179](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@anon\_14676179](https://discussions.unity.com/u/anon_14676179)\
**Post date:** [December 5, 2010, 2:26am UTC](https://discussions.unity.com/t/loading-the-next-level/430212/1 "2010-12-05T02:26:03Z")

</div>

Im making a game right now and have a gameobject that is tagged by; LevelExit when I touch this I want it to load the next level but it will not work because once i load the level and i want to leave the level im on now but it just reloads the level. here is my line of script that is going to help me accomplish this;

function OnControllerColliderHit (hit : ControllerColliderHit)  
{  
if(hit.gameObject.tag == “LevelExit”)  
{  
Application.LoadLevel(2);  
}  
}

---

<div class="post-metadata">

**Author:** ![Dreamora](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dreamora/32/91058_2.png) [@Dreamora](https://discussions.unity.com/u/Dreamora)\
**Post date:** [December 5, 2010, 3:13am UTC](https://discussions.unity.com/t/loading-the-next-level/430212/2 "2010-12-05T03:13:32Z")

</div>

use Application.LoadLevel(Application.loadedLevel+1)

that way it won’t end on the same, I have the feeling you might use this script in more than 1 level and thus the hardcoding to make it jump to scene number 2 (from build settings) won’t work well
