If it’s original DS4 controller, it should work out of the box. At least it did for me in UE4. If it’s not, or for some reason your original controller does not work, just use DS4 Windows. You will have to do this over and over after you restart your Computer. This will not help your game users.
If you want permanent solution, then enable raw input in your Project Settings.