UCharacterMovementComponent::HasCustomGravity
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: UFUNCTIONBlueprintPure
Description
Returns whether the character has a custom local gravity direction set, different from UCharacterMovementComponent::DefaultGravityDirection.
Caveats & Gotchas
- • Reflects the cached bHasCustomGravity flag, which is only updated inside SetGravityDirection() — it won't change unless that function has actually been called.
Signature
bool HasCustomGravity() const Return Type
bool Example
Branch rendering logic for custom-gravity characters C++
if (GetCharacterMovement()->HasCustomGravity())
{
UpdateOrientationToGravity();
} See Also
Tags
Version History
Introduced in: 5.4
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?