Now, I don’t really think this makes any sense… I am making a script to change between cameras as asked in my assignment. For my project I’m using the cameras as ‘floors’ to a dungeon, I did some tests earlier and I do know how to control them, I was making the scripts needed and, this is what my “warp” script looks like.
#pragma strict
var Lv1Camera : Camera;
var Lv2Camera : Camera;
var warpMessage : boolean;
var warpStyle : GUIStyle;
function Start () {
warpMessage = false;
Lv1Camera.enabled = true;
Lv2Camera.enabled = false;
}
function Update () {
}
function OnTriggerStay(other : Collider)
{
if(other.tag == "Player")
{
warpMessage = true;
if (Input.GetMouseButtonDown(1))
{
if (Lv1Camera.enabled == true)
{
Lv2Camera.enabled = true;
Lv1Camera.enabled = false;
}
}
else if (Lv2Camera.enabled == true)
{
Lv1Camera.enabled = true;
Lv2Camera.enabled = false;
}
}
}
function OnGUI()
{
if(warpMessage)
GUI.Label(Rect(0,Screen.height/2,512,512), "Use the Right-Click in your mouse if you are ready for the next level", warpStyle);
}
I placed the script on my prefab as normal, but, when I try to add the cameras I want to use as variables to the script in the inspector, Unity is just not letting me drag them there. I even tried making a third variable for a GameObject of any kind, and still, unity is not letting me drag objects into this particular script, can anyone tell me the reason why?