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
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
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
PrintDebugInformation
Prints useful information on the screen. Helpful for debugging.
Variables
Configuration
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
CurveType
Type Identifier for the curves created by this component.
States
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
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.
Last updated