I tried to add one of my scripts to a Unity project, but Unity claims that it does not exist. Now none of my scripts are working. I tried looking on the web, but apparently I'm the only person who uses UnityScript.
Here's the doorScript that started this problem:
#pragma strict // Smoothly open a door var smooth = 2.0; private var open : boolean; private var enter : boolean; var say : String; private var defaultRot : Vector3; var openRot : Vector3; function Start(){ defaultRot = transform.eulerAngles; } //Main function function Update (){ if(open){ //Open door transform.eulerAngles = Vector3.Slerp(transform.eulerAngles, openRot, Time.deltaTime * smooth); } else{ //Close door transform.eulerAngles = Vector3.Slerp(transform.eulerAngles, defaultRot, Time.deltaTime * smooth); } if(Input.GetKeyDown("e") && enter){ open = !open; } } function OnGUI(){ if(enter){ GUI.Label(new Rect(Screen.width/2 - 75, Screen.height - 100, 150, 30), say); } } //Activate the Main function when player is near the door function OnTriggerEnter (other : Collider){ if (other.gameObject.tag == "Player") { enter = true; } } //Deactivate the Main function when player is go away from door function OnTriggerExit (other : Collider){ if (other.gameObject.tag == "Player") { enter = false; } } The file is named doorScript.js. It worked on my last project so if you want to take it go ahead but it won't work on my FPS project.