PlayerStats
Last updated
Last updated
PlayerStats inherits from , which is an . Notice that all Damageable objects in FPS Engine inherit from
PLAYER STATES
maxHealth: The initial amount of health points the player has.
maxShield: The initial amount of shield points the player has.
FALL DAMAGE
takesFallDamage:Enables or disables fall damage. When true, the player takes damage when falling from a great height.
minimumHeightDifferenceToApplyDamage: The minimum distance (in units) the player must fall to take fall damage.
FallDamageMultiplier A multiplier applied to the base fall damage to determine the final damage dealt. Higher values mean greater damage per unit fallen.
AUTO HEAL
enableAutoHeal: Enables or disables automatic player healing over time.
healRate: The rate at which the player's health regenerates.
healAmount: The amount of health regained with each heal tick (alternative to healRate for discrete healing).
restartAutoHealAfterBeingDamaged:When true, being damaged resets the auto-heal timer, delaying healing until the timer expires again.
restartAutoHealTime: The time (in seconds) it takes for auto-heal to resume after being disabled by damage (if restartAutoHealAfterBeingDamaged
is true).
Controllable ( bool ) / Public get / Private set
Returns true if the player can be controlled.
Returns the value of "controllable"
Grant Control()
Force Controllable to be true.
Lose Control()
Force Controllable to be false.
CheckIfCanGrantControl()
Checks if the game is paused before providing control to the player.
Recommended usage over GrantControl to avoid issues.
Respawn( Vector3 position )
Respawns the player at a given position.
position: Position to teleport the player to.
PlayerStatsEditor.cs can be found as an external script.