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.
[SOLVED]Lua function to enable a GameObject
-
- Posts: 118
- Joined: Thu Dec 19, 2019 7:38 am
[SOLVED]Lua function to enable a GameObject
Last edited by mschoenhals on Sat Sep 12, 2020 9:52 am, edited 1 time in total.
Re: Lua function to enable a GameObject
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.
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.
-
- Posts: 118
- Joined: Thu Dec 19, 2019 7:38 am
Re: Lua function to enable a GameObject
Thanks Tony. Worked perfectly.
Re: [SOLVED]Lua function to enable a GameObject
Great! Glad to help.