RealDocs

UCharacterMovementComponent::GetMaxJumpHeight

function Engine Blueprint Since 4.0
#include "GameFramework/CharacterMovementComponent.h"
Access: public Specifiers: UFUNCTIONBlueprintCallablevirtual

Description

Computes the maximum height a jump can reach, based on JumpZVelocity and gravity.

Caveats & Gotchas

  • Does not account for CharacterOwner->JumpMaxHoldTime — use GetMaxJumpHeightWithJumpTime() if the character can hold the jump button to jump higher.
  • Returns 0 if GetGravityZ() is close to zero, avoiding a divide-by-zero rather than producing an infinite result.

Signature

virtual float GetMaxJumpHeight() const

Return Type

float

Example

Check whether a ledge is jumpable C++
const float LedgeHeight = ComputeLedgeHeight();
if (LedgeHeight <= GetCharacterMovement()->GetMaxJumpHeight())
{
	// Ledge is within jump range
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.