I generate a procedural quad and I want to add a box collider to it.
The problem is that when I add the collider via script the collider is a default box collider (1x1x1) placed at the origin:
To rotate a box collider to match your Quad, you would need a second GameObject (perhaps as a child?) with its Tranform set to have the necessary rotation to match the alignment of your geometry quad.
You could also perhaps use a MeshCollider and just feed the quad in directly. Note: MeshColliders only collide against the “outside” of the mesh, eg, the visible portion, so if the above is a flat one-sided quad, you’d need to duplicate the mesh faces to have it collide from either side.
If you’re interested in seeing other procgen stuff, check out my MakeGeo project: