Rotating a 2D overlap box based on another object's rotation.

I’d like to know, how I can rotate a 2D overlap box so that it has the same rotation as another GameObject(It is a parent. The overlap box doesn’t seem to rotate with the parent object.).

Nevermind I found a solution myself which involved using transform.localEulerAngles on the parent and then storing it’s z axis value in a variable.