update physics in Start()

hey, i am having an issue i think somone might be able to help out.

In my start function i am updating the size of a boxcollider2d that is set as a trigger in a for statement. i am fairly sure that 2 triggers can collide without a rigidbody.

in that same for statement i am also checking istouchinglayers on my box colliders and i cant seem to get a true bool back.

for(int i = 0;i<points;i++){
				go<em>.GetComponent<BoxCollider2D>().size = new Vector2(go_.GetComponent<BoxCollider2D>().size.x+32,go*.GetComponent<BoxCollider2D>().size.y+32);*_</em>

_ if(go*.GetComponent().IsTouchingLayers(LayerMask.GetMask(“asd”))){
Debug.Log(“NOT GETTING ANYTHING!”);
}
}*_

The description of IsTouchingLayers warns aboutthis case

to avoid it:

  • replace void Start() with IEnumerator Start()
  • run your collider changes in one for loop and the checks in a second one
  • put yield return new WaitForFixedUpdate(); between both loops