UCharacterMovementComponent::Buoyancy
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: UPROPERTYEditAnywhereBlueprintReadWrite
Description
Ratio controlling how much a character floats while swimming. 1.0 is neutral buoyancy and 0.0 means no buoyancy at all.
Caveats & Gotchas
- • Only affects vertical movement while MovementMode is MOVE_Swimming.
- • A value below 1.0 causes the character to sink even without downward input, which is useful for characters meant to swim near the bottom.
- • Values above 1.0 make the character float upward, which combined with JumpOutOfWaterPitch can cause characters to pop out of water unexpectedly.
Signature
float Buoyancy; Example
Make a character sink slowly C++
if (UCharacterMovementComponent* MoveComp = GetCharacterMovement())
{
MoveComp->Buoyancy = 0.9f;
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?