Default land movement mode: fly and gravity

I have set “Default Land Movement Mode” to fly in my blueprint character movement component. It works, but i can’t figure out how to set gravity when key is released so that my character would go back to the ground by itself. How could i achieve that?

you could use the “set enable gravity” node to enable gravity.
to make it trigger you could add an inputaction mapping and use the “released” pin to enable the gravity when the button is released.

try setting GetCharacterMovement()->GravityScale = 0; when entering flight mode and GetCharacterMovement()->GravityScale = 1; when going back to gravity