Low fps on new pc

So I just built a mini PC, but my fps is all over the place, when playing fortnite on dx12 lowest settings I'm getting average of 87 fps, but when on epic settings a average of 79, on cod warzone on balanced its almost unplayable averaging 73 fps and constant freezing every few seconds does anyone know what could be wrong? My cpu is ryzen 3 3200g and gpu rtx 4060 zotac.