> For the complete documentation index, see [llms.txt](https://fantacode.gitbook.io/melee-combat-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fantacode.gitbook.io/melee-combat-system/attack.md).

# Attack

**Attack Data** is a ScriptableObject that contains detailed information about a specific attack. It includes various attributes that define the attack’s behavior, visual and audio effects, and interactions with targets.

## Create Attacks

You can create **attacks** by going to <mark style="color:green;">Create > Combat System > Create Attack</mark>.&#x20;

<div align="left"><figure><img src="https://3464424545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuYXVsBPBq71gIDr5Gb7g%2Fuploads%2FhcTxjnePn9mL29tzipeO%2FAttack.png?alt=media&amp;token=882851ba-8495-4f03-aef3-6a74af9848e4" alt=""><figcaption></figcaption></figure></div>

**Attack Data**

<div align="left"><figure><img src="https://3464424545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuYXVsBPBq71gIDr5Gb7g%2Fuploads%2Fs5IKuTLQVYF7B0erL8z5%2Fimage.png?alt=media&amp;token=319b3987-2ed3-483b-aa58-009907eda486" alt=""><figcaption></figcaption></figure></div>

**General Settings:**

* **Animation Clip:** The animation associated with this attack.
* **Impact Start Time:** Start time of the impact relative to the animation.
* **Impact End Time:** End time of the impact relative to the animation.
* **Wait for Next Attack:** Indicates if the next attack should wait before being triggered.
* **Wait for Attack Time:** Time to wait before the next attack, relative to the animation.
* **Hitbox to Use:** The hitbox to apply for this attack.
* **Finisher:** Indicates if this attack is a finishing move.
* **Rotate to Target:** Determines if the character should always face the target during the attack.
* **Damage:** The amount of damage caused by this attack.
* **Hit Direction:** The direction in which the attack hits.
* **Reaction Tag:** Tag used to identify the reaction to this attack.
* **Unblockable Attack:** Indicates if this attack is unblockable.

**Override Reaction:**

* **Override Reaction:** Indicates if the reaction should be overridden.
* **Clip:** The animation clip associated with this reaction.
* **Will Be Knocked Down:** Indicates whether the character will be knocked down as part of this reaction.
* **Knock Down Direction:** The direction in which the character will be knocked down.
* **Lying Down Time Range:** The range of time (in seconds) for how long the character will remain lying down before getting up.
* **Override Lying Down Animation:** Indicates if the default lying down animation should be replaced with a custom one.
* **Lying Down Animation:** The animation clip to use for the lying down phase.
* **Get Up Animation:** The animation clip to use for the character getting up.
* **Is Synced Reaction:** Indicates if the reaction should be synced with the animation.
* **Sync Start Time:** Start time of the synced reaction, relative to the animation.
* **Rotate To Attacker:** Indicates if the target should be rotated during the reaction.
* **Rotation Offset:** Rotation offset applied to the target during the reaction.

**Override Blocked Reaction:**

* **Override Blocked Reaction:** Indicates if the blocked reaction should be overridden.
* **Blocking Clip:** The blocked animation clip associated with this reaction.
* **Is Synced Blocked Reaction:** Indicates if the blocked reaction should be synced with the animation.
* **Block Sync Start Time:** Start time of the synced blocked reaction, relative to the animation.
* **Rotate Target in Blocked:** Indicates if the target should be rotated during the blocked reaction.
* **Rotation Offset in Blocked:** Rotation offset applied to the target during the blocked reaction.

**Counter:**

* **Can Be Countered:** Indicates if this attack can be countered.

<figure><img src="https://3464424545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuYXVsBPBq71gIDr5Gb7g%2Fuploads%2Fst8eLWOsjqEqMLcrORtz%2Fimage.png?alt=media&amp;token=5597d743-841a-474a-9ccb-a4e57cbb6e21" alt=""><figcaption></figcaption></figure>

* **Counter Attack:** The AttackData associated with the counterattack.
* **Counter Start Time:** The relative time in the animation when the counterattack should begin.
* **Max Distance for Counter:** Maximum distance below which the counter can be performed.
* **Health Threshold for Counter:** Health threshold below which the counter can be performed.

**Target Matching:**

Target Matching Attacks in Unity include three types:

**Snapping**: Attacks are aligned directly with the target position, resulting in accurate strikes regardless of the player's position.

**Linear**: Executes attacks in a straight path toward the target

**Rootmotion**: Root Motion matching scales the attack animation so that the attacker reaches the target point accurately.

Choose the type that fits your attack needs and enhances your gameplay experience.

* **Move to Target:** Indicates if the character should move to the target.
* **Move Type:** The type of target matching movement.
* **Move Start Time:** Start time of the movement relative to the animation.
* **Move End Time:** End time of the movement relative to the animation.
* **Distance from Target:** The distance the character should move to from the target.
* **Ignore Collisions:** Indicates if collisions should be ignored during movement.
* **Weight Mask:** The weight mask applied during root motion.
* **Root Curves:** The root motion curves of this attack.
* **Snap Type:** The type of snapping to use for this attack.
* **Local Position from Target:** Local position offset from the target.
* **Snap Target:** The target to snap to for this attack.

**SFX (Sound Effects):**

* **Strike Sound:** Sound played when the strike occurs.
* **Hit Sound:** Sound played when the attack hits.
* **Blocked Hit Sound:** Sound played when the attack is blocked.
* **Reaction Sound:** Sound played when the target reacts to this attack.

**VFX (Visual Effects):**

* **Hit Effect:** Visual effect played when the attack hits.
* **Blocked Hit Effect:** Visual effect played when the attack is blocked.

**Camera Effects:**

* **Camera Shake Amount:** Intensity of the camera shake effect.
* **Camera Shake Duration:** Duration of the camera shake effect.
