cant enable a 2d box collider

Hey guys, I have a 2d box collider which I need to be enabled only when another sprite becomes visible.
So in an if statement which sets a boolean to true I want to say boxcollider2d. enabled =false/true.

Sounds simple enough but .enabled is not coming up as an option. I’m a bit confused as this has worked before and seems to be the only way to do what I need.
My script which I want to enable the collider in is part of a child game object along with the 2dboxcollider.

I’ve also tried making the size 0, 0 but the .size option isn’t available either.

Can anyone help me out?
Cheers guys.

I’ve tried this and worked for me like following:

this.gameObject.GetComponent<BoxCollider2D> ().enabled = false;

If you can paste a part of your code where you’ve tried to do this?

Ah, i’ve never seen it done that way, i’ll give it a go.
Cheers

that done the trick! cheers dude :slight_smile: