Hi, i got this error message in Unity:
Assets/Scripts/Res_levels/Pause.js(22,50): BCE0019: ‘Enabled’ is not a member of ‘UnityEngine.Component’.
And this is my code:
#pragma strict
var isPaused : boolean = false;
var player : GameObject;
var playerCamera : GameObject;
var playerMouseLook : Component;
var playerCameraMouseLook : Component;
function Start () {
playerMouseLook = player.GetComponent("MouseLook");
playerCameraMouseLook = playerCamera.GetComponent("MouseLook");
}
function Update () {
if (Input.GetKeyDown(KeyCode.Escape)) {
if (isPaused == false){
playerMouseLook.Enabled = false;
playerCameraMouseLook.Enabled = false;
}
else {
playerMouseLook.enabled = true;
playerCameraMouseLook.enabled = true;
}
}
}
Somebody knows what’s happening?
(Sorry for bad english)