# BP\_JumpingComponent

This page describes the Jumping Component that ships with Motion. The Jumping Component provides a custom jumping component and replaces the default Jump functionality. It features a camera bounce when jumping & landing and a stamina system providing dynamic jump force.

### Methods

#### Manipulators

| Name                       | Description                                                                                                     |
| -------------------------- | --------------------------------------------------------------------------------------------------------------- |
| AbortBounce                | Resets bounce state and saves the current target rotation                                                       |
| HandleImpactBounce         | Sets the bounce target and enables bounce state.                                                                |
| MoveCameraToTargetRotation | Adds the target offset to the core component                                                                    |
| ResetStamina               | Resets stamina values.                                                                                          |
| SetPlayerJumpEnabled       | Sets the ability to jump in the characters movement component.                                                  |
| UpdateDeltaSeconds         | Updates progress on either the jumping camera curve or the bounce camera curve, depending on the player's state |
| UpdateFallingVelocity      | Updates last known falling velocity if we fall. Used to prevent camera bounce from little drops.                |
| UpdateStamina              | Updates Stamina and determines if the player is capable of jumping (has enough stamina)                         |
| UpdateTargetRotation       | Handles Rotation updates given the current player state                                                         |
| ValidateRotationTarget     | Checks if we are close to the end of the bounce and stops it if so.                                             |

#### Event Handler

| Name                        | Description                                                                                            |
| --------------------------- | ------------------------------------------------------------------------------------------------------ |
| HandleOnEventBeginPlay      | Called when "Event Begin Play" gets called. Sets up events and saves base values.                      |
| HandleOnEventTick           | Core logic handlers. Handles rotation and stamina updates.                                             |
| HandleOnJumpJumped          | Called when after a jump was executed. Useful for post-jump logic.                                     |
| HandleOnJumpPressed         | Called when the player presses the Jump key. Adjusts the JumpZ Velocity based on the available stamina |
| HandleOnJumpReleased        | Called when the player releases the jump key. Currently unused.                                        |
| HandleOnJumpStopped         | Called after \\"Jump Stopped\\" has executed. Currenly unused.                                         |
| HandleOnMovementModeChanged | Called when the movement mode changes (e.g. from falling to walking)                                   |
| HandleOnPlayerLanded        | Called when the player has landed on the floor. Resets stamina and jump states.                        |

#### Debug

| Name                  | Description                                                     |
| --------------------- | --------------------------------------------------------------- |
| PrintDebugInformation | Prints useful information on the screen. Helpful for debugging. |

***

### Variables

#### Configuration

| Name                  | Description                                                                            |
| --------------------- | -------------------------------------------------------------------------------------- |
| CameraBounceCurve     | The curve used for the jumping bounce.                                                 |
| bShowDebugInformation | If true, various useful variables will be printed on the screen to help with debugging |
| bIsEnabled            | If false, the component will only print debug data and not update any other values.    |

#### Constants

| Name      | Description                                               |
| --------- | --------------------------------------------------------- |
| CurveType | Type Identifier for the curves created by this component. |

#### States

| Name              | Description                                                                                                      |
| ----------------- | ---------------------------------------------------------------------------------------------------------------- |
| bIsFalling        | If true, the current movement mode of the player is Falling.                                                     |
| bIsRecovering     | If true, the players jump stamina is currently recovering.                                                       |
| bIsBounceReversed | If true, the characters camera is currenly bouncing back up from a previous bounce down from landing on a floor. |
| bIsBouncing       | If true, the characters camera is currently bouncing down from landing on a floor.                               |
| bIsJumping        | If true, the player is currently jumping.                                                                        |
| bWantsToJump      | If true, the player has signalized that they want to jump (usually by pressing the jump key)                     |

#### Component Data

| Name                  | Description                                                                                                                                                 |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| BounceTargetRotation  | The current target rotation for the camera bounce for when the player lands on a floor.                                                                     |
| CurrentTargetRotation | The current rotation the component rotates towards to.                                                                                                      |
| StaminaStartRotation  | Saved rotation from when the player starts jumping while low on stamina. Used to for smoother camera movement between bounce, sprint and low-stamina jumps. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://motion.docs.regensturm.com/components/bp_jumpingcomponent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
