I have a game, which has multiple scene. what i think is, when the character to go to a location, and the scene would change, and the character will spawn in the new scene, how do i write script?
create a boxcollider, scale it and place at the end.
check isTrigger in Inspector to true.
create a script attach it to the boxcollider.
here is untested code:
using UnityEngine;
using System.Collections;
public class EndOfLevel: MonoBehaviour {
public string Level = "Level 0";
void OnTriggerEnter(Collider other) {
if (other.gameObject.CompareTag("Player"))
Application.LoadLevel(Level);
}
}
Sources:
http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.OnTriggerEnter.html
http://unity3d.com/support/documentation/ScriptReference/GameObject.CompareTag.html
http://unity3d.com/support/documentation/ScriptReference/Application.LoadLevel.html
hope it helps!