# Behaviours

{% hint style="info" %}
[Plant](/en/creator/game-maker/docs/components/triggers/plant.md), [Button](/en/creator/game-maker/docs/components/triggers/button.md), [Light](/en/creator/game-maker/docs/components/display/light.md), [Visual FX](/en/creator/game-maker/docs/components/display/visual-fx.md) behaviours switched to be components in Game Maker 0.10 for more interactive use cases.
{% endhint %}

## What is a Behaviour?

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MgiHh4vdwujPCB75QIX%2F-MgiLjkxfYFDMi7M_ZkN%2FGMA_GitBook_Behaviour_Heading_02.png?alt=media&#x26;token=4c4fef7d-21ee-43ed-9432-99333a08a1d0" alt=""><figcaption><p>Each object may have ONE behaviour</p></figcaption></figure>

A behaviour is a bundle of logic that applies action characteristics and identity tags to an object. This controls how it will function in your Experience and how it will be detected by other objects.

{% hint style="info" %}
**OBJECT LOGIC**

[Behaviours](/en/creator/game-maker/docs/behaviours.md) relate to object or Experience actions. An object may have only **ONE**.

[Components](/en/creator/game-maker/docs/components.md) relate to player actions. An object may have **one of each** type.
{% endhint %}

Behaviours allow you to quickly build dynamic interactions between objects, with many parameters that can be customised to create unique gameplay. No coding experience is needed!

**Examples:**

[Healer](/en/creator/game-maker/docs/behaviours/npc-ai-pawns/healer.md) chases and heals an object with a specific tag that needs health.

[Melee Enemy](/en/creator/game-maker/docs/behaviours/npc-ai-pawns/melee-enemy.md) chases and attacks a specific tag.

[Predator](/en/creator/game-maker/docs/behaviours/npc-ai-pawns/predator.md) chases and attacks [Prey](/en/creator/game-maker/docs/behaviours/npc-ai-pawns/prey.md) as food, which flees **Predator** and seeks [Plant](/en/creator/game-maker/docs/components/triggers/plant.md) as food.

A [Button](/en/creator/game-maker/docs/components/triggers/button.md) can be set up to open a [Door](/en/creator/game-maker/docs/behaviours/movement/door.md) when players interact with it.

[Timed Events](/en/creator/game-maker/docs/behaviours/basic-logic/timed-events.md) can trigger [Weather Switcher](/en/creator/game-maker/docs/behaviours/visual/weather-switcher.md) to change the time of day, sky colours, clouds, stars, etc. in a preset cycle or based on player actions.

## General Uses for Behaviour Types

The behaviour groupings below are how they're often used. However, [Farmer](/en/creator/game-maker/docs/behaviours/npc-ai-pawns/farmer.md) behaviour simply allows an object to randomly remove other objects in its path from the game. Think outside the box based on what behaviours can do, and you'll dream up amazing custom interactive play in no time!

{% hint style="success" %}
**Tip:** You can select multiple objects and change the same parameters simultaneously.
{% endhint %}

{% hint style="success" %}
**Tips:** Press CTRL+D to duplicate custom objects or groups of objects. Create [Side Bar](/en/creator/game-maker/docs/build-menus/side-bar.md#presets) if you must build with them repeatedly or want to spawn them during live gameplay.
{% endhint %}

**No behaviour applied:** The object can be a prop or be interactive if [Components](/en/creator/game-maker/docs/components.md) are applied.

{% tabs %}
{% tab title="Archetypes" %}

### NPCs

An NPC is usually a person, creature, etc. When this type of behaviour is applied to an object, properties are included to create interactive potential:

* :label: identity tags, which allow other objects to detect it
* :dart: tags to detect on nearby objects and respond to (flee, attack, heal, food, or gather)

Modify object tags and the tags their behaviours are set to detect for custom interactions.

### Behaviours

[Citizen](/en/creator/game-maker/docs/behaviours/npc-ai-pawns/citizen.md)**:** Passive walking object, flees *Hostile* tag by default.

[Farmer](/en/creator/game-maker/docs/behaviours/npc-ai-pawns/farmer.md)**:** Passive walking object, harvests *Plant* tag and flees *Hostile* tag by default.

[Melee Enemy](/en/creator/game-maker/docs/behaviours/npc-ai-pawns/melee-enemy.md)**:** Chases and attacks *Avatar* tag by default. Has *Hostile* tag by default.

[Healer](/en/creator/game-maker/docs/behaviours/npc-ai-pawns/healer.md)**:** Restores health. By default it flees *Hostile* and seeks *Friendly* and *Avatar* tags.

[Plant](/en/creator/game-maker/docs/components/triggers/plant.md)**:** Prey and Farmer seek its default *Plant* tag. No death visual effects when "killed."

[Predator](/en/creator/game-maker/docs/behaviours/npc-ai-pawns/predator.md)**:** Chases and attacks *Prey* and *Avatar* tags and has *Hostile* tag by default.

[Prey](/en/creator/game-maker/docs/behaviours/npc-ai-pawns/prey.md)**:** Passive walking object that seeks *Plant* tag and flees *Hostile* tag by default.

[Soldier](/en/creator/game-maker/docs/behaviours/npc-ai-pawns/soldier.md)**:** Passive walking object that attacks when it is attacked or detects a *Hostile* tag.&#x20;

{% hint style="info" %}
**CUSTOM INTERACTIONS**

**Examples:**

:crossed\_swords:Create barbarians to attack Soldiers. Apply **Melee Enemy** behaviour with **Tags to Attack** set as *Soldier*. Apply **Soldier** behaviour to objects (includes *Soldier* tag).

:wastebasket: Create volunteers to remove garbage. Apply **Farmer** behaviour with **Gathering Tags** set as *Trash*. Apply **Plant** behaviour to various objects, adding the **Tag** *Trash*.
{% endhint %}
{% endtab %}

{% tab title="Management" %}

### Experience Management

[Animated Decoration](/en/creator/game-maker/docs/behaviours/visual/animated-decoration.md)**:** Plays specified animations, each followed by a message.&#x20;

[Actor Property Switcher](/en/creator/game-maker/docs/behaviours/modifiers/actor-property-switcher.md)**:** Change physics of objects in range during play.

[Message Broadcaster](/en/creator/game-maker/docs/behaviours/basic-logic/message-broadcaster.md)**:** Precisely control how to send a message, can repeat forever.

[Timed Events](/en/creator/game-maker/docs/behaviours/basic-logic/timed-events.md): Sends messages after parent and sub-event timers; linear logic, loops.
{% endtab %}

{% tab title="Engagement" %}

### Player Engagement

[Asker](/en/creator/game-maker/docs/behaviours/basic-logic/asker.md)**:** Pop up box posing a question with 4 answer options that each send a message.

[Button](/en/creator/game-maker/docs/components/triggers/button.md)**:** Sends a message upon interaction.

[Crowd Event](/en/creator/game-maker/docs/behaviours/basic-logic/crowd-event.md)**:** Emotes or messages reach a collaborative goal; success or fail messages.

{% hint style="danger" %}
**STREAMING BEHAVIOURS**

Uploading custom content for use with Video and Audio Streaming behaviours is currently limited to The Sandbox and select partners. These behaviours are in development for widespread public use.
{% endhint %}
{% endtab %}

{% tab title="Ambience/Feel" %}

### Experience Ambience/Feel

[Post Process Effects](/en/creator/game-maker/docs/behaviours/visual/post-process-effects.md): Visual modifier for the camera with various effects to customise.

[Weather Switcher](/en/creator/game-maker/docs/behaviours/visual/weather-switcher.md): Changes environmental ambience (sun, stars, clouds, etc).
{% endtab %}

{% tab title="Add/Remove" %}

### Add or Destroy Blocks, Assets & Avatars

[Asset Spawner](/en/creator/game-maker/docs/behaviours/modifiers/asset-spawner.md)**:** Spawns a specified asset (can offset).

[Replace Asset](/en/creator/game-maker/docs/behaviours/modifiers/replace-asset.md): Switch an asset to a different asset.&#x20;

[Multi](/en/creator/game-maker/docs/behaviours/modifiers/multi.md)**:** Spawns a specified block in a defined space (3x3 or larger) around the object.

[Void](/en/creator/game-maker/docs/behaviours/modifiers/void.md)**:** Destroys specified blocks, assets, or avatars within a defined space.
{% endtab %}

{% tab title="Motion" %}

### Motion-Based

[Bird](/en/creator/game-maker/docs/behaviours/movement/bird.md)**:** Flies clockwise in a circle. Randomise movement with height and width ranges.

[Basic Platform](/en/creator/game-maker/docs/behaviours/movement/basic-platform.md)**:** Moves back and forth in any direction, can face the direction of motion.

[Door](/en/creator/game-maker/docs/behaviours/movement/door.md)**:** Plays door animations, allows entry; rotates 90 degrees and back at its pivot point.
{% endtab %}
{% endtabs %}

## Add a Behavior to an Object

One behaviour may be applied to an object to control its actions. Many [Components](/en/creator/game-maker/docs/components.md) can be applied to an object to make it more interactive.

{% tabs %}
{% tab title="1. Select" %}

1. Left click to select an object. This will open the **Properties Panel** on the right side of the screen.

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MghmZ1IXv8Cdqn0OxcG%2F-MgiAl9n-oTYgK1IV3MK%2FBehaviour_Properties_Panel_02.png?alt=media&#x26;token=e6fa4780-cb41-4a41-814b-9b8040cd9e2e" alt=""><figcaption><p>Click any object to open the Properties Panel.</p></figcaption></figure>
{% endtab %}

{% tab title="2. Open Behaviours Window" %}
2\. Beneath **Attributes**, click on the **Behaviour** field where it says **NONE** or displays the currently applied behaviour.

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MghmZ1IXv8Cdqn0OxcG%2F-MgiCX6SUoinz26mTx5r%2FBehaviour_Properties_Panel_01.png?alt=media&#x26;token=4e0950a9-0df8-4a52-9410-3bfef2203fbe" alt=""><figcaption><p>Behaviour details are located in the Properties Panel under Attributes.</p></figcaption></figure>
{% endtab %}

{% tab title="3. Select" %}
3\. A window named **Select Behaviour** will pop up with available options. In this example, we’ll choose the **Soldier** behaviour.\
\
The **Select Behaviour** window will close, and the chosen behaviour will now appear in the **Properties Panel** along with its default settings.

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MgiHh4vdwujPCB75QIX%2F-MgiP20SGCe73syI1QvB%2FProperties_Behaviour_01.png?alt=media&#x26;token=75a0e299-7f6b-4b07-bbdd-6fd99fdc3e5c" alt=""><figcaption><p>The behaviour you select is added to object in the Properties Panel.</p></figcaption></figure>

In our **Soldier** behaviour example, default logic is automatically added, including:

* the **Patrol Zone** of the entity
* the **Walk Speed**, **Run Speed**, **Attack Damage** and **Attack Speed**
* **Tags to Attack** is set as *Hostile*
* a **Health Component** which allows the soldier to receive damage if attacked
* tags so other objects with can detect it with their behaviours

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MgiPRVS0ccLVZqzfK0e%2F-MgiZ_K32f77g_XUUL1L%2FBehaviour_Variables_01.png?alt=media&#x26;token=dccea6cf-0905-44c9-8d79-2db18596b575" alt=""><figcaption><p>Edit the object's behaviour, components, and tags in the Properties Panel</p></figcaption></figure>
{% endtab %}

{% tab title="4. Customise" %}
4\. Click the **Edit Logic** button to see the full [Behaviour & Component Parameters](/en/creator/game-maker/docs/using-assets-and-objects/behaviour-and-component-parameters.md) for any behaviour and components applied to the object.\
\
Here you can see how the object will work in your Experience and customise parameters such as **Walk Speed**, **Tags to Attack**, **Message sent on death**, etc. \
\
You can also scroll to the bottom of the object's properties and change its identity tags so it will be detected specific to your game's mechanics.\
\
Test your logic frequently by presssing the **TAB** key to toggle on and off Play mode.

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MgiZswabEj2ewWynH9x%2F-MgjFdx2c9JMSHuoDXnd%2FBehaviour_Edit_Logic_01.png?alt=media&#x26;token=a32b644c-fc63-4e89-8913-1a0ed80cf767" alt=""><figcaption><p>Click <strong>Edit Logic</strong> to inspect and customise the object's behaviour and components</p></figcaption></figure>

If you need to go back to the default view of the Properties Panel, click the **X** next to **Logic** at the top. Your settings will not be lost.

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MgcmwPFPQHMO32UkIOJ%2F-MgdVmxBA_7-4jzcCjkr%2FExit_Edit_Logic_01.png?alt=media&#x26;token=7a99343a-bff0-48e2-b5bf-fdc2b9c3bd1a" alt=""><figcaption><p>Click the <strong>X</strong> at the top left to go back to the default Properties Panel view</p></figcaption></figure>
{% endtab %}
{% endtabs %}

<table><thead><tr><th>Type</th><th>Behaviour</th><th>Performance</th><th data-type="number">Max Amt</th><th data-type="number">Perf in Scope</th></tr></thead><tbody><tr><td>Movement</td><td>Bird</td><td>Medium</td><td>61</td><td>null</td></tr><tr><td>Movement</td><td>Door</td><td></td><td>null</td><td>null</td></tr><tr><td>Movement</td><td>Advanced Platform</td><td></td><td>null</td><td>null</td></tr><tr><td>Movement</td><td>Projectile</td><td></td><td>null</td><td>null</td></tr><tr><td>Movement</td><td>Basic Platform</td><td></td><td>null</td><td>null</td></tr><tr><td></td><td></td><td></td><td>null</td><td>null</td></tr><tr><td></td><td></td><td></td><td>null</td><td>null</td></tr><tr><td></td><td></td><td></td><td>null</td><td>null</td></tr></tbody></table>


---

# 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.sandbox.game/en/creator/game-maker/docs/behaviours.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.
