If you google “ue4 adapt to terrain” you should be able to see how to do it.
E.g.
In first image it’s a simple line trace which you can expand with multiple once and find an average, ofc lerp etc, just to give you the idea.
Second image is for the movement (assuming it’s the one that usually comes standard) also to give you the general idea. The second image is getting the forward axis for the movement based on the character and control rotation since now it’s not gonna be on a flat Z plane, so we’re making our own.
This is a prototype from my Alien Xeno movement prototyping early on and also to warn you, Epic really did not care 1 bit for anything other then humanoid or something that stays upright when moving so it can get janky so I also suggest to later on work on a completely new movement component as well. But this should hopefully get you started.
I’m stuck on wall walking with my project so yours hopefully should be much easier. Good luck!