Hi guys,
So I’m making a short FPS and I use different scenes to display some text /informations. Basically when the player is next to an object and wants to examine it, he hits E which loads another scene on top of my first one with Application.LoadLevelAdditive.
That’s my script (on the player):
void OnTriggerStay (Collider target) {
if (target.tag == “1_tomb”)
if (Input.GetKeyDown (KeyCode.E)) {
Application.LoadLevelAdditive(1);
}
}
The problem is that this script seems to load the second level several times - sometimes up to 5 times (which is problematic as I use some transparency effects on the second level and it’s very visible that several objects are loaded)
So, could somebody explain why this happens and how I can make it so that the level is loaded only ones?
Thanks for the help!