[SOLVED]Lua function to enable a GameObject

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mschoenhals
Posts: 118
Joined: Thu Dec 19, 2019 7:38 am

[SOLVED]Lua function to enable a GameObject

Post 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.
Last edited by mschoenhals on Sat Sep 12, 2020 9:52 am, edited 1 time in total.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Lua function to enable a GameObject

Post 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.
mschoenhals
Posts: 118
Joined: Thu Dec 19, 2019 7:38 am

Re: Lua function to enable a GameObject

Post by mschoenhals »

Thanks Tony. Worked perfectly.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: [SOLVED]Lua function to enable a GameObject

Post by Tony Li »

Great! Glad to help.
Post Reply