Tilting character to surface. Lost in vector math. help please

The Ninja character movement plugin on the Unreal Marketplace does all the things.