Page 1 of 1

How to Enable/Disable DialogueSystemTrigger

Posted: Fri Apr 14, 2023 10:18 pm
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 182 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

Re: How to Enable/Disable DialogueSystemTrigger

Posted: Fri Apr 14, 2023 10:59 pm
by Tony Li
Hi,

That should work.

Are you sure targetInteract is non-null?

Are there any errors or warnings in the Console window?

Re: How to Enable/Disable DialogueSystemTrigger

Posted: Sat Apr 15, 2023 8:37 am
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!

Re: How to Enable/Disable DialogueSystemTrigger

Posted: Sat Apr 15, 2023 2:24 pm
by Tony Li
Happy to help. I'm glad it's working now!