Hi guys wt i want to know is i eve this next script attached to a game object so when i click it i load a new scene, everything works fine but i hv one issue and 1 question... 1- Right now i can click for all over the place and i get teleported, so wt i need some help is to only work when inside a certain range. 2- how i can teleport inside the scene i select but to a specific Vector3 position? For example if im in town and i teleport to inside a dungeon i go to begining, thats right, but if i port back right now it goes to start point of town, and i want it to return to the teleport position in town of dungeon entrance. Appreciate any help Code (CSharp): using UnityEngine; using System.Collections; public class EnterDungeon : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { if(Input.GetMouseButton(1)) { Application.LoadLevel("Dungeon"); } } }
For your second question, Use DontDestroyOnLoad (http://docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html) to keep an object in your dungeon at the teleport's location and when you go back to your dungeon, scan if such an object exist. If it does, move there. Or store your teleport's position in a static variable and use that.