BCE0019: 'enabled' is not a member of 'Object'. (68358)

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;

}

2 Answers

2

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.

pauseFilter has no type and no initialization, so it is Object. give your variables type. private var pauseFilter : AClassIJustMadeUp;

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 http://forum.unity3d.com/threads/177902-BCE0019-enabled-is-not-a-member-of-Object?p=1216682#post1216682 The answer is type casting it which im trying