Next Level (Loadlevel)

Can anyone help me.I need script for next level when i click some object with FPC to go to next level. Sorry for bed English and tnx.

You can load the next level using the following:

Application.LoadLevel(Application.loadedLevel + 1);

Obviously you will need to perform bounds checking on the level index, but this is the general idea.

See: Unity - Scripting API: Application.LoadLevel

You could try this:

private void OnMouseDown()
{
Application.LoadLevel(“Whatever level you want to load”);
}

and attach the script to the object (drag and drop the script onto the GameObject).

Really though go on youtube and search out some tutorials, try the burgzerg tutorials for example as they talk you through a lot of different scripting and unity scenarios. There are lots of other tutorials out there as well, one of the major advantages to unity is the community.

You’re also going to have to pick which programming language you’re going to use. Personally I’d learn c# if you’re starting out as it’s faster, it’s a bit more fussy though so for a noob (and not too long ago I was that noob) it can be harder. Still it’s faster, and if you’ve got to learn it from scratch then why not go for the fastest.

I know this is an old post, but I have a strange thing happening. When I load next level using:

		void Update()
	{

		if (Controller.GetHairTriggerDown())
		{
			if (collidingObject) //I added the item to the conditional
			{
			Application.LoadLevel (Application.loadedLevel + 1);

Because I use Htc Vive instead of the Mouse Click,.
This only works from my first scene, and it doesn’t let me go through scenes in chronological order, but if I use scene name:

Application.LoadLevel ("Floor2");

It will send me to any scene I want.

Any ideal why this is happening?