BoxCollider doesnt change position when I flip the player!

So I am creating a 2D platformer and I have an issue. I have a flip function in my script so i can flip the player depending on the key i press(when I press A look left, D look right…) but the boxcollider2D remains at the first position the one i look right even do my character is flipped to the left. Here are some photos.
Thanks in advance!

Your problem sounds to be a “pivot” problem.
Place the collider carefully on the character body and move the pivot of your sprite, so the center of the sprite is the character body.