Hi,
When my player enters NPC trigger a window pops up, but i can look around and it confuses me a lot.
How can I get my players look components and disable them?
part of NPC’s script:
var Show = false;
function OnTriggerEnter(other : Collider)
{
Show=true;
other.MouseLook.enabled = false;
other.MainCamera.MouseLook.enabled = false;
}
function OnTriggerExit(other : Collider)
{
Show=false;
other.MouseLook.enabled = true;
other.MainCamera.MouseLook.enabled = true;
}
function OnGUI()
{
if(Show)
{
windowRectMission = GUI.Window (0, windowRectMission, WindowFunctionMission, "Harry");
}
}
And I tried to do like this:
lookAround01 = other.GetComponent(MouseLook);
lookAround02 = other.Find("Main Camera").GetComponent(MouseLook);
Can anyone help?