Hi @UltraConstructor , welcome to the 2D forums. It looks like you are trying to access the field as if it was static. What you can do instead is create a field to reference your polygon collider and call enable using that reference:
public PolygonCollider2D m_PolygonCollider2D;
void OnMouseDown()
{
m_PolygonCollider2D.enabled = true;
}
make sure that you assign correct PolygonCollider2D in the inspector to make it work.
Also, to make it easier for other users to read your code, make sure that you tag it properly. You ca refer to this post:
There is also a great beginner’s tutorial on C# scripting tutorials on our Lean page.