🐾MAttack Trigger
Last updated
Last updated
This component is the default damager used with colliders to do damage to the characters.
It requires a collider set as a trigger. By default, it will create a box collider when this component is added to a gameobject.
This component works heavily with the Attack Trigger Behaviour. Which Activate the Attack trigger via Animator Behaviours:
Reference for the Collider needed by this component. This is a required field*
Enable/Disable the Damager.
Index of the Damager. Often used by the Animator to know which Attack Trigger to enable/disable via an Animation.
Usually, the Animals have more than one Attack Trigger: Horns, Mouth, Claws, Feet, Swords... Each Attack can use this index to activate the proper Damager while making the animation.
Layers to interact with objects. By Default is set that affects only the Animal Layer.
Set the Interaction that the Damager will have with Triggers.
When the Damager is using Raycast or OnTriggerEnter, sometimes it can register colliders inside the same hierarchy the Damager is. When this option is enabled, these colliders will be ignored.
By default, the Owner is the Root of the hierarchy. But it can be set Manually to another gameobject. If this value is set to null, it will be set again to the Root of the hierarchy.
Profiles can change the way an Attack Trigger interacts with any Object. Use this to override values of an Attack Trigger depending the Animation is playing. It can be used to create cool finishing Moves of a Combo attack. The final blow can push the Animal Hitted and it can cause twice the damage:
The values inside the Profiles are the same parameters you can override in the Attack Trigger component.
Use the Index of the Profile to activate it. When the Animation Ends the Profile will be restored and the Default values will be applied on the next Attack Trigger Activation
When a Damager registers a collider, it will find any MDamageable Component on its hierarchy and it will apply all the modifications necessary to that gameobject
Which StatID do you want to modify and what do you want to do to it? There are various values in the drop-down.
The minimum and maximum values to modify the stat. If set as the same then it will obviously be a static value.
If this parameter is set to true the Damager Receiver (MDamageable) will ignore its default multiplier. Resulting in pure damage.
Type of Element that this Weapon/Attack Trigger can inflict e.g. Fire, Ice, etc.
The critical damage will apply a chance to increase or decrease the final value of the Stat modifier. Probability of making critical damage.
The Stat Modifier value will be multiplied by this value if the critical chance is true.
When a Damager registers a collider, it will apply a force to the attached rigidbody. You can set the Min and Max Force here.
Type of force to apply on the ApplyForce() method.
The Damager receiver will apply its default Reaction .
You can set your own custom reaction here. This will override the Damager Receiver default reaction.
If the Damage Receiver has any Interactable component attached it will send an interaction using the InteractorID value.
Index to send to the Interactable.
This Gameobject will be enabled on impact. If it's a Prefab, it will be instantiated.
Time the Animator will be stopped. If it's zero, stopping the animator is ignored.
Value of the Animator Speed when it's stopped
If there's an Animator Controller, it will be stopped
Invoked when the AttackTrigger hit something. Returns the Damager Receiver Transform as Parameter
Invoked when the AttackTrigger hit something. Returns the position of the hit on the Damager receiver
Invoked when the Damage Receiver is an Interactable. Returns the Interactable ID as Parameter
Invoked when the damage profile changes
Invoked when the Attack Trigger is enabled
Invoked when the Attack Trigger is enabled