PlayerStats
PlayerStats inherits from IDamageable.cs, which is an interface. Notice that all Damageable objects in FPS Engine inherit from IDamageable.cs.
PlayerStats also implements these interfaces: IPlayerStatsProvider, IFallHeightProvider
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).
Functions and Accessors | PlayerStats.cs
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.
Last updated