FPS ENGINE DOCUMENTATION
  • Welcome to FPS Engine!
  • BEFORE WE START
    • Early Considerations
    • List of Tutorials
    • List of Add-Ons & Compatible Packages
  • GETTING STARTED
    • 01. Basic set-up
    • 02. Roadmap
  • CONTENT
    • 03. Content
      • 03.1 CAMERA
        • MoveCamera
        • CameraFOVManager
      • 03.2 MOVEMENT
        • PlayerMovement
      • 03.3 PLAYER
        • PlayerStats
        • PlayerMultipliers
        • PLAYER STATES
          • PlayerStates
          • PlayerBaseState
          • PlayerStateFactory
        • WEAPON STATES
          • WeaponStates
          • WeaponBaseState
          • WeaponStateFactory
        • Player Debugging
      • 03.4 WEAPONS
        • Weapon_SO
        • WeaponIdentification
        • WeaponController
        • Bullet
        • ATTACHMENTS
          • Attachment.cs
            • Barrel.cs
            • Flashlight.cs
            • Magazine.cs
            • Scope.cs
            • Stock.cs
            • Laser.cs
            • Grip.cs
          • AttachmentIdentifier_SO.cs
      • 03.5 PICK UP SYSTEM
        • InteractManager
        • Interactable
        • Item_SO
        • Identifiable
        • Pickeable
          • WeaponPickeable
          • BulletsPickeable
          • AttachmentPickeable
      • 03.6 ENEMIES
        • IDamageable
        • EnemyHealth
        • TrainingTarget
        • CIrcularTargetEnemy
        • Turret
        • TurretProjectile
      • 03.7 EFFECTS
        • CameraEffects
        • CamShake
        • CrouchTilt
        • JumpMotion
        • ProceduralShot
        • ProceduralShot_SO
        • WeaponEffects
        • WeaponSway
      • 03.8 UI
        • CowsinsButton
        • Crosshair
        • CrosshairShape
        • Hitmarker
        • UIController
        • UIEvents
        • RebindUI
      • 03.8 EXTRA
        • Checkpoint
        • Coin
        • Compass
        • CompassElement
        • Destructible
        • Crate
        • ExplosiveBarrel
        • PowerUp
        • DamageMultiplier
        • HealMultiplierPowerUp
        • Healthpack
        • DoorInteractable
        • Experience
        • GetGameInformation
        • HurtTrigger
        • JumpPad
        • Lootbox
        • PauseMenu
        • PointCapture
        • Trigger
        • DraggableButtonInSceneView
        • UTILITIES
          • DestroyMe
          • IgnoreCollision
          • LookAt
          • CowsinsUtilities
      • 03.09 MANAGERS
        • CoinManager
        • ExperienceManager
        • GameSettingsManager
        • InputManager
        • SoundManager
        • PoolManager
  • HOW TO USE
    • Getting Started: First Steps
    • Importing FPS Engine into URP / HDRP
    • Add a Player Controller
    • Adding New Weapons
    • Saving & Loading Presets
    • Changing Keybindings
    • Creating New Pickeables
    • Controllable & Not Controllable Player
    • Adding New Surfaces ( Grounds )
    • Working with Attachments
    • Modify Weapon and Camera Effects
    • Adding Custom Key Rebinds
    • Add breakable (Destructible) objects
    • Custom Shot Weapons
    • Adding Enemies
  • FAQ
    • FAQ
  • SUPPORT
    • Support
Powered by GitBook
On this page
Export as PDF
  1. CONTENT
  2. 03. Content
  3. 03.3 PLAYER

PlayerStats

Previous03.3 PLAYERNextPlayerMultipliers

Last updated 10 months ago

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).

Functions and Accessors | PlayerStats.cs

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.

IDamageable.cs
interface
IDamageable.cs