- Home /
BCE0019: 'enabled' is not a member of 'Object'.
function PauseGame() {
savedTimeScale = Time.timeScale;
Time.timeScale = 0;
AudioListener.pause = true;
if (pauseFilter) pauseFilter.enabled = true;
currentPage = Page.Main;
transform.position = new Vector3(0, 1, 0);
Screen.lockCursor = false;
}
Answer by Loius · Apr 11, 2013 at 09:16 AM
you're right. it's not.
put #pragma strict
back in at the top of the script and fix the errors which that reveals. lazy-typing causes problems if you don't know what's what.
After putting #pragma strict the error is same as above and here I provided the top part of the script:
#pragma strict
var skin:GUISkin;
private var gldepth = -0.5;
private var startTime = 0.1;
var nativeVerticalResolution = 1200.0;
var scaledResolutionWidth = nativeVerticalResolution / Screen.height * Screen.width;
var mat:$$anonymous$$aterial;
private var tris = 0;
private var verts = 0;
private var savedTimeScale:float;
private var pauseFilter;
private var showfps:boolean;
private var showtris:boolean;
private var showvtx:boolean;
private var showfpsgraph:boolean;
var lowFPSColor = Color.red;
var highFPSColor = Color.green;
var lowFPS = 30;
var highFPS = 50;
//var start : GameObject;
var url = "WebPlayer.html";
var statColor:Color = Color.yellow;
var GuiColor:Color = Color.white;
pauseFilter has no type and no initialization, so it is Object. give your variables type.
private var pauseFilter : AClassIJust$$anonymous$$adeUp;
Answer by HmoudMO · Apr 11, 2013 at 10:38 AM
True, its not a member of Object, its basically a member of GameObject. I cannot see a clear code of what pauseFilter is, you can try casting "as GameObject", but that might not work depending on the case, share the full code with us, that would let us help you more.
enabled is not a member of GameObject - it is a member of anything derived from Behaviour.
This script can be used by everyone as long as credits intach there
The answer is type casting it which im trying