# Melee Enemy

{% hint style="success" %}
**COPY/PASTE PARAMETERS**

New in GM 0.11! Right click on a behaviour or component to copy. Then open an object, add the same behaviour or component, and right click it to paste identical parameter settings.
{% endhint %}

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MOysCPJoQe0JbvXjJMh%2F-MOysemH_mptSuqDWB4p%2FFighter.gif?alt=media&#x26;token=97ec5a8a-261f-4ec6-9dac-22b51e093524" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
This behaviour has not yet been migrated for use in multiplayer Experiences.
{% endhint %}

## ![](https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FffAasqjmymTGmyNAtt4A%2Fimage.png?alt=media\&token=dc62f847-c1cb-4fca-9792-0d5372cd17b9) Melee Enemy

* Walk within a defined zone - Attacks Avatar within his range - Once attacked by something, it counter attacks immediately

## Common Uses

* Enemy NPCs, or non-player characters, that will attack players, Citizens, Soldiers, etc.
* Creating factions of fighters with specific targets using Tags
* Creating anything that will use Attack animations and destroy other Objects (even non-living things - apply a Health Component and hide the health bar)

## Communications

<table data-header-hidden><thead><tr><th width="278"></th><th></th></tr></thead><tbody><tr><td><p><strong>Inputs:</strong></p><p>Detects specified Tags (default Tag is Avatar)</p></td><td><p><strong>Outputs:</strong></p><p>If any of its Tags to Attack are detected, moves toward and attacks the Avatar or Objects with its target Tags</p></td></tr></tbody></table>

<img src="https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/xLjOJ3DIEztJFDMEF39e/file.excalidraw.svg" alt="" class="gitbook-drawing">

## Parameters

| Options                                                                                            | Details                                                                                                                                                                                                                                                                                                                               |
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/JsMspFopTmkIB1VszoO7/image.png) | Parameters with a ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/qvRLl6KU5qkb16Nrmd88/image.png) symbol are currently locked and cannot be interacted with.                                                                                                                                                       |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/KiYXtAg80eLpMs6wtJJV/image.png) | **Tags to Attack** - Add or remove tags that you want the Object to attack upon detection.                                                                                                                                                                                                                                            |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/HXb84mZew4EXrOMBPUl4/image.png) | **Motion Speed** - Defines the amount of blocks traveled by the Object while chasing a target.                                                                                                                                                                                                                                        |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/L0tUR1PqGcO4cRmaR57b/image.png) | **(Locked)**                                                                                                                                                                                                                                                                                                                          |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/m58LgzrgtkSpJpZ4Nqsv/image.png) | <p><strong>Chasing Zone</strong> (slider) - defines the area in which your Object can chase a target.<br><br>This parameter is visualised with a <mark style="color:green;"><strong>green</strong></mark> circle Gizmo that adjusts as you move the slider or change the value.</p>                                                   |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/TPV2TlVMAPPLZQsYkypd/image.png) | **(Locked)**                                                                                                                                                                                                                                                                                                                          |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/2VdeUVe7YSPII5BaVKzj/image.png) | *<mark style="color:green;">**Can Block Attacks**</mark>* - Toggle this option on or off to define whether your Object is able to block attacks.                                                                                                                                                                                      |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/VWVetTRMFamkSOI1S20N/image.png) | <p><em><mark style="color:green;"><strong>Attack Damage</strong></mark></em> (slider) - Defines how many points of damage your Object will deal with a single hit.<br><br><em><mark style="color:green;"><strong>Attack Rate</strong></mark></em> (slider) - Defines the time in seconds between each attack the Object performs.</p> |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/zD0wGPSOjlHXdoIBn1Zc/image.png) | <p><strong>Detection Range</strong> (slider) - defines the area in which your Object will detect <mark style="color:red;">tags to attack</mark>.<br><br>This parameter is visualised with a <mark style="color:yellow;"><strong>yellow</strong></mark> circle Gizmo that adjusts as you move the slider or change the value.</p>      |
