C++ turn off character gravity?

What’s the c++ version to turn off character gravity? BP version is to set the gravity scale to zero on the movement component.

124590-capture.png

If you are using class inherited from ACharacter, you use GetCharacterMovement()->GravityScale. When I have similar problem, I usually try to look for the blueprint function name in API search :slight_smile:

1 Like

That gave an error, but thanks. The answer is GetCharacterMovement()->GravityScale = 0;

This worked GetCharacterMovement()->GravityScale = 0;

Mea culpa, I corrected that. It’s weird, since objective oriented paradigm says that you shouldn’t be able to edit variables directly.

Sorry to recover the post… but take in mind that if GravityScale is public, you can …

greetings.