Unreal unusable due to lag

Hi, I have the same problem.
my build is composed as follows:
CPU: AMD 5900x
VGA: 6700xt
RAM 32gb

But despite this it lags both UE5 and UE4.

Any solutions?