- Home /
Question by
sugarlandrun · Jan 03, 2016 at 09:03 AM ·
scenescene-loadingloadlevel
Enter building script for a open world game
On trigger enter the game will load the scene, but the problem is that it will reset everything and i tried "dontdestroyonload" but then everything will respawn again, and also it wont spawn you outside the building, i want it so that i can choose where the player spawns when he returns back outside.
for people that want to know here is my script (Javascript)
#pragma strict
var leveltoload : String;
function OnTriggerEnter (collider : Collider) {
if (collider.gameObject.tag == "Player"){
Application.LoadLevel(leveltoload);
}
}
Comment
Your answer
Follow this Question
Related Questions
Can you create transitions between levels using Application.LoadLevel? 6 Answers
cannot access the next scene 1 Answer
Loading bar for NEXT scene/level... 1 Answer
Level Load Display Delay 0 Answers
Load and run scene in background 1 Answer