Quick answer: Unity TilemapCollider2D taking a frame to update after runtime tile edits? Composite collider regeneration is deferred - call CompositeCollider2D.GenerateGeometry() to apply same-frame.

Destructible terrain: clearing a tile leaves a phantom collider for one frame, letting a fast bullet still hit it.

Force composite regeneration

tilemap.SetTile(pos, null);
composite.GenerateGeometry();

The composite collider only rebuilds on its own physics-step schedule. GenerateGeometry() forces it inline so the next raycast sees the new shape.

Or disable the composite

For high-frequency edits, drop the CompositeCollider2D and use per-tile box colliders. You pay more in collider count but avoid the merge-on-step pipeline entirely.

Check the right collider type

If you don't have a composite, the TilemapCollider2D's Used By Composite flag controls this. With the flag off, edits apply immediately; with it on, they wait for the composite.

“Composite colliders are an optimization with a fixed-frequency cost - and that frequency is when bugs appear.”

If you only edit one tile per frame, the per-tile collider path is the simpler one. The composite earns its keep when you're clearing dozens at once.