# Blade Component

The **Blade Component** is a Unity component that must be attached to a prefab game object used as the scene representation of a weapon. It serves two purposes:

On one hand, it allows to display *particle* and *sound effects* when clashing with other scene objects, as well as show a trail during the activation phase of an attack.

On the other hand, it is also responsible for determining and collecting the enemies hit by the weapon during an activation phase.

![(Blade Component)](/files/-M1V4xPDQtN4XeHuItBI)

**Debug Mode** allows to display internal information about the sword slash. This is useful if you don't have a weapon trail or it's barely perceptible and you want to know why an attack is not hitting an enemy.

![(Debug information about the trail and hit casts)](/files/-M1V6_oMObkFssGjgJOv)

### **Blade Edge**

**Blade Edge** positions allow to define a segment that will be used for both the trail of the weapon and detecting hits (when the weapon is required to) if the **Capture Hits** dropdown is set to segment.

![(Point A and Point B define a segment that goes along the blade)](/files/-M1V8Hu8Fd0UucckRSBG)

These **Blade Edge Point A** and **Point B** fields should go along the whole blade (in case of a *Sword*) or along the head (in case of a *Hammer* or *Axe*).

### Capture Hits

The **Capture Hits** dropdown allows to select how you want to detect hits using this weapon. As for now you can choose between two options:

* **Segment:** Detects hits by *Raycasting* along the blade of the weapon (determined by Point A and Point B). However, in order to avoid ghosting through objects due to a fast slash, it also checks inter-frame objects. This is determined by the **Segment Resolution**: The lower the value, the more precise. However, it will also be more costly. Something around 0.5 should fit most cases.&#x20;
* **Sphere:** Detects hits by casting a sphere at a specific position and processes any objects caught inside. This is the most performant capture mode, and should be used if you're targeting mobile devices or WebGL platforms.

### Blade Trail

The **Blade Trail** is a custom made trail effect used during the *Activation* phase of an attack. Because most attacks are too fast to be perceived by the human eye, it's a common practice to draw a trail that represents the blur of the moving weapon at a high speed.

This effect can be customized to use a custom **Material** as well as define its **Duration** and how smooth the trail will look using the **Granularity** field.

The *Trail* will always use the segment defined by **Point A** and **Point B** from the *Blade Edge* section.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gamecreator.one/melee/melee/weapons/blade-component.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
