Page 1 of 1

[SOLVED]Lua function to enable a GameObject

Posted: Thu Sep 10, 2020 9:17 am
by mschoenhals
Is it possible to have a Lua script function that enables a gameObject at some point during a conversation? Also, if possible, I'd like the conversation to end first before the gameObject is enabled.

Thanks in advance.

Re: Lua function to enable a GameObject

Posted: Thu Sep 10, 2020 10:45 am
by Tony Li
Hi,

Instead of a Lua function, you can use the SetActive() sequencer command.

You could also use a scene event.

However, since you want it to happen after the conversation ends (instead of, say, the last node of a conversation), add a Dialogue System Trigger to one of the participants. Set it to On Conversation End. Then select Add Action > Set GameObjects Active/Inactive.

Re: Lua function to enable a GameObject

Posted: Sat Sep 12, 2020 9:52 am
by mschoenhals
Thanks Tony. Worked perfectly.

Re: [SOLVED]Lua function to enable a GameObject

Posted: Sat Sep 12, 2020 10:18 am
by Tony Li
Great! Glad to help.