BPAC_LPSP_Stamina
Introduction
The Stamina Actor Component (BPAC_LPSP_Stamina) is a Blueprint Actor Component designed to manage a character's stamina.
This component is crucial for managing actions that require stamina, such as running or jumping. By adjusting stamina costs and regeneration rates, you can easily tweak the gameplay feel.
If you seek to access the BPAC_LPSP_Stamina, it is conveniently located at the following path: LowPolyShooterPack/Core/Characters/BPAC_LPSP_Stamina.
Editable Variable
Max Stamina:
This variable indicates the maximum stamina that a character can have. It is the upper limit for the stamina level.
Jump Stamina Cost:
This variable represents the amount of stamina used up each time the character jumps. It decreases the current stamina level whenever a jump action is performed.
Private Variables
Stamina:
This variable denotes the current stamina level of the character.
Running:
This variable indicates whether the character is currently running, which might affect the stamina level.
Last Frame Stamina:
This variable keeps track of the stamina level from the previous frame. It is useful for comparing changes in stamina over time.
Blocked Stamina Updates:
This variable is a flag that, when set to true, prevents updates to the stamina level.
Functions
Get Stamina Percent:
This function returns the current stamina level as a percentage of the maximum stamina. It's useful for displaying stamina in a user interface.
Jump:
This function deducts the "Jump Stamina Cost" from the current stamina level.
Can Jump:
This function checks if the character has enough stamina to perform a jump. It returns true if the current stamina level is greater than or equal to the "Jump Stamina Cost", and false otherwise.
Last updated
Was this helpful?
