How to change the orientation for an overlapbox?

Hi there, after a good amount of searching I haven’t been able to find out how to change the rotation of my overlap boxes set up.

//draw a hitbox in front of the character to see which objects it collides with
Vector3 boxPosition = transform.position + (Vector3.up * lastAttack.collHeight) + Vector3.right * lastAttack.collDistance;
Vector3 boxSize = new Vector3 (lastAttack.CollSize/2, lastAttack.CollSize/2, hitZRange/2);
Collider[] hitColliders = Physics.OverlapBox(boxPosition, boxSize, transform.rotation, HitLayerMask);

I’m using it for damage calculation.
I want the OverlapBox to take the same rotation of the player and always be in front of the player.

Have you figured this out ? I’m trying to achieve the exact same thing but can’t seem to figure it out. I tried changing the angle attribute but it does nothing.,Hey have you possibly figured this out? I need to do the exact same thing for a 2D topdown RPG. I have tried changing the angle attribute but to no avail.

Hello, did you find any solution for this? Or did you use box collider or mesh collider instead?