# How can I evoke narrative design trigger after specific event?

**URL:** <https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681>\
**Category:** Unity SDK\
**Tags:** question, unity\
**Created:** [September 14, 2024, 4:44pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681 "2024-09-14T16:44:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 4:44pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/1 "2024-09-14T16:44:52Z")

</div>

**Original Discord Post by \_\_\_1576 | 2024-09-14 16:44:52**

Hello, I am working on Narrative Design in Convai and trying to implement it in Unity. I want to evoke a trigger that activates when a specific ‘event’ occurs, not just when entering a certain space. However, I can’t figure out how to do this. How can I achieve this? I apologize if my writing is unclear, as I’m not very good at English. Thank you.

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 4:49pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/2 "2024-09-14T16:49:06Z")

</div>

**Reply by k3kalinix | 2024-09-14 16:49:06**

Hello \<@785917121926266892\> 👋🏻,

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 4:49pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/3 "2024-09-14T16:49:14Z")

</div>

**Reply by k3kalinix | 2024-09-14 16:49:14**

Welcome to Convai Community!

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 4:53pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/4 "2024-09-14T16:53:08Z")

</div>

**Reply by k3kalinix | 2024-09-14 16:53:08**

Which version of Convai are you using?

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 4:54pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/5 "2024-09-14T16:54:03Z")

</div>

**Reply by kagura4549 | 2024-09-14 16:54:03**

Im sure documentation had somthing similar to the three types of triggers it talked about.  
But if you arent able to work with that then u can use a similar solution i posted to my problem and u can alter it such that when that certain `event` occurs, there should be a prompt sent to the NPC and you can alter the narrative design part of the NPC from playground such that when that specific prompt is being recieved by the NPC, it should behave to however you want the NPC tobehave when that event occurs

My problem: [Discord](https://discord.com/channels/890819304386338856/1283920045873041461)

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 4:57pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/6 "2024-09-14T16:57:41Z")

</div>

**Replying to k3kalinix’s Message**

> **Reply by k3kalinix | 2024-09-14 16:53:08**  
> Which version of Convai are you using?

**Reply by \_\_\_1576 | 2024-09-14 16:57:41**

How can I check which version it is? I’m still a beginner, sorry😥

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 4:58pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/7 "2024-09-14T16:58:57Z")

</div>

**Replying to kagura4549’s Message**

> **Reply by kagura4549 | 2024-09-14 16:54:03**  
> Im sure documentation had somthing similar to the three types of triggers it talked about.  
> But if you arent able to work with that then u can use a similar solution i posted to my problem and u can alter it such that when that certain `event` occurs, there should be a prompt sent to the NPC and you can alter the narrative design part of the NPC from playground such that when that specific prompt is being recieved by the NPC, it should behave to however you want the NPC tobehave when that event occurs

My problem: [Discord](https://discord.com/channels/890819304386338856/1283920045873041461)

**Reply by \_\_\_1576 | 2024-09-14 16:58:57**

Oh, I will check it out. Thank you for letting me know!!

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 4:59pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/8 "2024-09-14T16:59:07Z")

</div>

**Replying to \_\_\_1576’s Message**

> **Reply by \_\_\_1576 | 2024-09-14 16:57:41**  
> How can I check which version it is? I’m still a beginner, sorry😥

**Reply by k3kalinix | 2024-09-14 16:59:07**

When did you download?

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 5:02pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/9 "2024-09-14T17:02:45Z")

</div>

**Reply by \_\_\_1576 | 2024-09-14 17:02:45**

I’m not really sure, it was probably between July 10th and 20th, 2024

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 5:04pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/10 "2024-09-14T17:04:22Z")

</div>

**Reply by k3kalinix | 2024-09-14 17:04:22**

```cs
if (TryGetComponent(out NarrativeDesignTrigger narrativeDesignTrigger))
  {
    narrativeDesignTrigger.InvokeSelectedTrigger();
  }

```

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 5:04pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/11 "2024-09-14T17:04:27Z")

</div>

**Reply by k3kalinix | 2024-09-14 17:04:27**

Create a script

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 5:04pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/12 "2024-09-14T17:04:37Z")

</div>

**Reply by k3kalinix | 2024-09-14 17:04:37**

And use this method.

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 5:05pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/13 "2024-09-14T17:05:33Z")

</div>

**Reply by k3kalinix | 2024-09-14 17:05:33**

It is up to you to customize this.

The basic logic is to call the Invoke SelectedTrigger function of narrativeDesignTrigger when an event occurs.

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 5:08pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/14 "2024-09-14T17:08:07Z")

</div>

**Reply by \_\_\_1576 | 2024-09-14 17:08:07**

Thank you. I want to evoke a trigger when a specific event occurs. In that case, should I add the method to the script of that event?

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 5:14pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/15 "2024-09-14T17:14:13Z")

</div>

**Reply by k3kalinix | 2024-09-14 17:14:13**

Ok but don’t use trygetcomponent for your case

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 5:18pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/16 "2024-09-14T17:18:33Z")

</div>

**Reply by k3kalinix | 2024-09-14 17:18:33**

```cs
[SerializeField] private NarrativeDesignTrigger _narrativeDesignTrigger;

private void YourFunction()
{
_narrativeDesignTrigger.InvokeSelectedTrigger();
}

```

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 5:23pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/17 "2024-09-14T17:23:53Z")

</div>

**Reply by \_\_\_1576 | 2024-09-14 17:23:53**

I tried it as you suggested, but I encountered the following error.

“The type or namespace name ‘NarrativeDesignTrigger’ could not be found (are you missing a using directive or an assembly reference?)”

In fact, I had previously tried the same method because the Convai documentation provided a similar code, but I got the same error back then, which is why I ended up asking for help here 😦 How can I resolve this?

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 5:25pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/18 "2024-09-14T17:25:24Z")

</div>

**Reply by k3kalinix | 2024-09-14 17:25:24**

add this

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 5:25pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/19 "2024-09-14T17:25:30Z")

</div>

**Reply by k3kalinix | 2024-09-14 17:25:30**

using Convai.Scripts.Runtime.Features;

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [September 14, 2024, 5:27pm UTC](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681/20 "2024-09-14T17:27:37Z")

</div>

**Reply by \_\_\_1576 | 2024-09-14 17:27:37**

The type or namespace name ‘Features’ does not exist in the namespace ‘Convai.Scripts.Runtime’ (are you missing an assembly reference?)

This time, this error has occured. I’m so sorry for asking so many questions.😥

[Next page](https://forum.convai.com/t/how-can-i-evoke-narrative-design-trigger-after-specific-event/1681.md?page=2)
