> For the complete documentation index, see [llms.txt](https://docs.lootlocker.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lootlocker.com/legacy/triggers/activate-a-trigger.md).

# Activate a trigger

{% hint style="info" %}
You are viewing legacy triggers. We've launched a new trigger system, it's much more powerful and flexible! [Check it out!](/game-systems/triggers.md)
{% endhint %}

## Work With Triggers in Game

{% hint style="warning" %}
The following tutorial assumes you have already set up your game and made your first API calls. To learn how to do that, visit the [Getting Started](/the-basics/readme.md) guide.
{% endhint %}

After [settings up some triggers](/legacy/triggers/create-a-trigger.md) in the console we can implement it in the game.

#### Trigger Event

Calling this in the game will award the player with any score/XP or assets we set up while create the trigger.

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

```csharp
string triggerName = "test";
LootLockerSDKManager.ExecuteTrigger(triggerName, (response) =>
{
    if (response.success)
    {
        Debug.Log("Successfully triggered event");
    }
    else
    {
        Debug.Log("Error triggering event");
    }
});
```

{% endtab %}

{% tab title="Unreal" %}

<figure><img src="/files/EdAZlJDjbYLLnW2ByeTK" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/re0lw8x4">Blueprint example of executing a trigger</a></p></figcaption></figure>
{% endtab %}
{% endtabs %}

To learn more about the endpoint you can check out our reference documentation on [triggering an event](https://ref.lootlocker.io/game-api/#triggering-an-event)

#### Retrieving Previously Triggered Triggers

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

```csharp
LootLockerSDKManager.ListExecutedTriggers((response) =>
{
    if (response.success)
    {
        Debug.Log("Successfully retrieved triggered events");
    }
    else
    {
        Debug.Log("Error retrieving triggered events");
    }
});
```

{% endtab %}

{% tab title="Unreal" %}

<figure><img src="/files/Iwt4ItpzxLOm6rRoVuBj" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/u90ze_4e/">Blueprint example of getting a list of previously triggered triggers</a></p></figcaption></figure>
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.lootlocker.com/legacy/triggers/activate-a-trigger.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.
