Bonjour!
This video shows an experiment on a basic control rig(standard project on Unreal Engine 5), which calculates the normal of the surface on which the foot is located. Maybe someone will come in handy.
Music:
Sam Paganini - Rave (Original Mix)