How to Enable/Disable DialogueSystemTrigger

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
AvalonGames
Posts: 10
Joined: Wed Apr 27, 2022 11:01 pm

How to Enable/Disable DialogueSystemTrigger

Post by AvalonGames »

Hey, so I been playing around with the Dialogue System and noticed there's an Action "OnEnabled". From what I understand the documentation explains that the action will trigger when the component is Enabled
code.png
code.png (13.59 KiB) Viewed 193 times
I have this block of code that enables the Dialogue System Trigger component on the targeted gameObject.

This works if I were to use BoxCollider2D or any Unity Components but unfortunately it doesn't have the same effect with the Dialogue System Trigger.

I was wondering how I could enable/disable the component from my c# script.

Cheers
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to Enable/Disable DialogueSystemTrigger

Post by Tony Li »

Hi,

That should work.

Are you sure targetInteract is non-null?

Are there any errors or warnings in the Console window?
AvalonGames
Posts: 10
Joined: Wed Apr 27, 2022 11:01 pm

Re: How to Enable/Disable DialogueSystemTrigger

Post by AvalonGames »

So I looked into it this morning and it's working as you expected.

I had my inspector on the target gameObject and it shows the Dialogue System Trigger as disabled. Only when I click to another gameObject and back to the target, does it show it as updated on the inspector window.

Regardless it seems to be working :)

Thanks again for the fast response!
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to Enable/Disable DialogueSystemTrigger

Post by Tony Li »

Happy to help. I'm glad it's working now!
Post Reply