BoxCollider2d not getting enabled when added in runtime.

Temp.AddComponent();
Temp.collider2D.enabled = true;

I’m using this snippet to add a box collider to an object. The collider comes as disabled and stays disabled. Any idea? (Also tried Temp.BoxCollider2D.enabled = true; Same problem)

2D colliders do not get added as disabled so I have no idea what is going wrong there.

Just guessing, but is the Temp object itself maybe disabled?