ACharacter::ClearJumpInput
#include "GameFramework/Character.h"
Access: public
Specifiers: virtualENGINE_API
Description
Called each frame after CheckJumpInput to update JumpKeyHoldTime and clear bPressedJump once the hold window expires. Ends the active jump-force phase when JumpMaxHoldTime is exceeded.
Caveats & Gotchas
- • This is the function that clears bPressedJump after it has been processed. If you override CheckJumpInput and consume bPressedJump early, ClearJumpInput will still run and may behave unexpectedly — always pair overrides of both functions carefully.
- • ClearJumpInput increments JumpKeyHoldTime each frame while the jump key is held. If StopJumping() is never called, this can exceed JumpMaxHoldTime and keep the character receiving upward velocity indefinitely.
Signature
ENGINE_API virtual void ClearJumpInput(float DeltaTime); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| DeltaTime | float | Delta time in seconds since the last frame. | — |
Return Type
void Example
Limit jump hold time dynamically based on power-up state C++
void AMyCharacter::ClearJumpInput(float DeltaTime)
{
// Temporarily boost hold time during a power-up
float OldHoldTime = JumpMaxHoldTime;
if (bJumpBoostActive)
{
JumpMaxHoldTime *= 2.0f;
}
Super::ClearJumpInput(DeltaTime);
JumpMaxHoldTime = OldHoldTime;
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?