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
  • Identity
  • Statistics
  • UI
  • Functions and Accessors | EnemyHealth.cs
Export as PDF
  1. CONTENT
  2. 03. Content
  3. 03.6 ENEMIES

EnemyHealth

Reworked in 1.3 Update

PreviousIDamageableNextTrainingTarget

Last updated 8 months ago

Oriented at enemies only.

Check some examples of EnemyHealth usage:

Identity

  • _name: Name of the enemy. This will appear on the killfeed

Statistics

  • maxHealth: initial enemy health

  • maxShield: initial enemy shield

If DestroyOnDie is set to false, your object won’t be destroyed once you kill it.

  • destroyOnDie: When the object dies, decide if it should be destroyed or not.

    • deathEffect

UI

  • showUI: If true, it will display the UI with the shield and health sliders

    • healthSlider: Slider to display the health

    • shieldSlider: Slider to display the shield

Click on Create Default UI to generate and automatically assign Health & Sliders

  • showDamagePopUps: Enables and disables Damage Pop Ups, which appear on hitting enemies.

    • damagePopUp: Damage Pop Up object, stored at Cowsins/Prefabs/Others

    • xVariation: Horizontal randomness variation

Click on Assign Default Damage Pop Up to automatically add a reference to the default Damage Pop Up in FPS Engine ( Recommended to use )

  • showKillFeed: If true, it will display the KillFeed UI on eliminating an enemy

  • events

Functions and Accessors | EnemyHealth.cs

isDead ( bool ) / Protected ( only accessible from scripts that inherit from Interactable.cs )

Returns true if the enemy is dead

Player ( Transform )

Returns the player transform.

health ( float ) / ReadOnly

Returns the current health of the enemy.

shield ( float) / ReadOnly

Returns the current shield of the enemy.

Start() / virtual function

Update() / virtual function

Damage(float _damage, bool isHeadshot) / virtual function

Damage the enemy.

  • damage: Damage to apply on damageable´s health.

  • isHeadshot: Whether the shot landed on critical areas or not.

Die() / virtual function

TrainingTarget
CircularTargetEnemy