RealDocs

ACharacter::JumpMaxHoldTime

property Engine Blueprint Since 4.8
#include "GameFramework/Character.h"
Access: public Specifiers: UPROPERTYEditAnywhereBlueprintReadWriteReplicated

Description

The maximum time in seconds the jump key can be held to continue receiving upward velocity. Set to 0 (default) for an instantaneous jump with no variable height. Set to a positive value to enable hold-to-jump-higher behavior.

Caveats & Gotchas

  • If `StopJumping()` is never called before `JumpKeyHoldTime` reaches `JumpMaxHoldTime`, the character keeps receiving vertical velocity for the full hold time regardless of whether the key is still pressed. Always bind `StopJumping()` to the button-release input event.
  • This property is replicated, so it should be set on the server or in the character's constructor. Changing it only on the client will be overwritten by the next replication update.
  • With `JumpMaxCount > 1` (multi-jump), `JumpMaxHoldTime` applies independently per jump. Each jump in a multi-jump sequence can be held for up to `JumpMaxHoldTime` seconds.

Signature

UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated, Category=Character, Meta=(ClampMin=0.0, UIMin=0.0))
float JumpMaxHoldTime

Examples

Enable variable-height jumping by setting Jump Max Hold Time Blueprint
Event BeginPlay Cast To ACharacter Object Cast Failed As ACharacter Set Jump Max Hold Time Target is Character Target Jump Max Hold Time Jump Max Hold Time 0.35 0.35 Get Player Character Player Index 0 0 Return Value
Edit Blueprint graph Enable variable-height jumping by setting Jump Max Hold Time
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
Enable variable-height jumping in the constructor C++
AMyCharacter::AMyCharacter()
{
	// Allow the player to hold jump for up to 0.35 seconds for extra height
	JumpMaxHoldTime = 0.35f;
}

Version History

Introduced in: 4.8

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.