I am trying to do a pause button on my game, and i want the camera to stop moving, i tied to disable the component but it says enabled its not a part of UnityEngine.GetComponent.
so here is the pause script(its attached to the camera as well as the Mouse Look):
#pragma strict
var isPaused : boolean = false;
var PauseGUI : GUI;
PauseGUI.enabled = false;
function Update (){
if (Input.GetKeyUp(KeyCode.P)){
if (isPaused){
isPaused = false;
}
else{
isPaused = true;
}
}
if (isPaused){
Time.timeScale = 0.000001;
PauseGUI.enabled = false;
GetComponent("Mouse Look").enabled = false;
}
else{
Time.timeScale = 1;
PauseGUI.enabled = false;
}
}
thank you all, and if you need more information plz tell me.
GetComponent(“Mouse Look”).enabled = false;
replace with
MouseLook ml = GetComponent("MouseLook");
ml.enabled = false;
AFAIK in JS this will look like
var ml : MouseLook = GetComponent(MouseLook);
ml.enabled = false;
Pleese give normally work script!!!
Thanks but help very need. Project which created in historical faculty not normally work without script (as pause and so on). Studing C+ and Java is very difficult for some humanities. But 3d engine is very popular and needed tools in digital archaeology and historical research. Who any help?
For project - Virtual Reconstruction of Moscow Monastery «All Sorrow Joy» 1909 year
http://hist.msu.ru/3D/Joy_of_all_sorrow.htm
Ph.D. Student
Denis Zherebyatiev
Lomonosov State University
Historical faculty
Historical Informational Science