- Home /
BoxCollider2D can't enable in runtime
Hey. I'm trying to add a 2d boxcollider to a sprite in runtime. For some reason, it gets disabled and I cannot re-enable it.
Temp.AddComponent<BoxCollider2D>();
Temp.collider2D.enabled = true;
Any idea? Thanks.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613132727im_/https://answers.unity.com/themes/thub/images/avi.jpg)