Basically what’s supposed to happen is the player can walk up to a door of a building in a town (where a collider is) and press ‘E’ to change to that scene. But instead of the player needing to be in the collision trigger, they can press e from anywhere and transition scenes. So I just assumed that “innTrigger” is automatically being assigned as true for some reason. I appreciate all the help!!! ![]()
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class SceneChange : MonoBehaviour {
public Text pressE;
public Collider Player;
public string Scene;
public bool innTrigger;
void Start ()
{
pressE.text = "";
innTrigger = false;
}
void OnTriggerEnter (Collider Player)
{
innTrigger = true;
pressE.text = "Press 'E' to Enter";
}
void Update ()
{
if (innTrigger = true)
{
if (Input.GetKeyDown ("e"))
{
Application.LoadLevel (Scene);
}
}
}
void OnTriggerExit (Collider Player)
{
innTrigger = false;
pressE.text = "";
}
}