# Components, Actions & Events

## Welcome to the world of components!

Components are special actions you can add to any object in the game in order to create logic, or mechanics, using Linking.

When it comes to linking, each component has a set of unique instructions referred to as "Actions & Events."

* "**Actions**" are what need to happen to trigger an event - interacting with an item; entering a certain area; after 5 seconds has passed, etc.
* “**Events**" are what happens in response to the action - the player has entered, so the door locks; 5 seconds have passed, so now the object will start moving over here, etc.

These are what make up the game's "if X happens, I do Y."&#x20;

Easy, right?

In Linking Mode, any object that has a component will have a little orange square hovering at its centre. When you click on the square, it will expand and highlight the whole entity - this is especially useful if an entity is hidden inside another entity, like spikes hidden underground before they are activated to shoot up and trap an unwary player.

![Only the objects with components](/files/oaSWzqMI7RNJPeku0sC4)

When the orange square expands, there will be a little **+** on its right hand side. To begin a new link, click it and a list of all the possible Actions this object can perform (based on what components it has attached) will appear.&#x20;

Select whatever Action you want to be the triggering factor, and now a little spaghetti noodle should be attached to your mouse. You can now drag this onto any other orange box, OR back onto the original object (by clicking the little round arrow on the top right corner of the selection box) to create a *self-link* 🔄

![A self-link /// A link to another entity](/files/8YlH4R0chSWiIWuzVhYo)

Complete the link by selecting the Event. The line should now go rigid and have a little red circle in the middle of it. Clicking this will open a drop-down of all the links between these two objects. Clicking one of these in the drop-down will delete the link you just clicked. An object with a self-link will have the red circle appear within the orange box.

![Completed self-link and link to a Player Component](/files/Vx4VColQLEkzoe8TG5hn)

Links can also be made from entities onto [Player](/tools/linking/player-components.md) and [Game Components](/tools/linking/game-components.md), for actions you want to affect more than just the worldspace, like losing health or respawning.

Eventually, your links may look something like this...

![](/files/lOe561FBlcunbJFvaXeJ)

Each component has a set list of Actions and Events they are both capable of, but these can be mixed around and played with for all kinds of different results.&#x20;

For example, a Mover component's set list of Actions and Events are:

**ACTIONS**

* Stopped moving
* Started moving
* Reached start position
* Reached end position

**EVENTS**

* Move
* Stop moving
* Move forward
* Move backward
* Teleport to start position
* Teleport to end position
* Toggle start/stop moving


---

# 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.mutate.games/tools/linking/components-actions-and-events.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.
