Links

MDamageable

Overview

This component is in charge of connecting the Animal Controller to any Damager Component. This will receive the Direction, Stat to modify and it will make an Animal Reaction accordingly to the Damager information
This Component Requires a reference to the Stats Component
This component can be also used on child colliders to simulate specific damages.
E.g.
  • You can add a MDamageable Component to the Head collider, and add a Multiplier of 2 to simulate Headshots that makes twice the damage value.
  • You can add a MDamageable Component to the Chest collider, Shield, or a Head Helmet, add a Multiplier of 0.5 to simulate Defense, and only do half the Damage.

Internal MDamageables

The component can be also set inside the Animal Hierarchy. This is very useful to create different damages and reactions to the animal.
For example, you can add an MDamageable component to the Head Collider, with a multiplier of 2 and a Reaction set to Play the Stun Action for 3 Seconds. If the Animal receives direct damage to the head collider, the Damage value will double and it will play a stun animation instead of the Damage Animations.

Parameters

Reaction

Reaction to apply on the Animal when receiving Damage. By Default it will apply Mode Damage on the Animal. but you can change it and use any other Animal Reaction.
You can add a MDamageable Component to the Head collider and change the reaction to activate a Stun Animation instead.

Stats

Reference to the Stats component

Multiplier

Value to apply an extra modification to the Stats to make Double Damage, or acts as Defense value if is set to a value between 0-1.

On Receive Damage

Invoked when the Damageable receive damage. Sends the Value of the Stat modification.

On Critical Damage

Invoked if the Damage received is Critical. This is send by any of the Damager Components.