ACharacter::JumpMaxHoldTime
#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
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?