Changing gravity based on trace hit

There is no default or easy way to do what you want.

Anyway, idea of custom gravity means that you need to create special movement component from flying.movement.