Page 1 of 1

Execute change scene script during conversation

Posted: Fri Jul 16, 2021 9:51 am
by sch
Hello,

I would like to know how to make a script work during a conversation.

For example I have a script that change scene. And I would like the script to function when the player choose the answer.

Example :
NPC : Do you want to go there ?
Player ; Yes (Execute the script to change scene)
Player : No (Nothing)

Thank you :)

Re: Execute change scene script during conversation

Posted: Fri Jul 16, 2021 9:57 am
by Tony Li
Hi,

You can use the LoadLevel() sequencer command in the dialogue entry node's Sequence field. If you're using the Dialogue System's save system, it will change scenes properly for use with the save system. Otherwise it will make a regular SceneManager.LoadScene() call.

Re: Execute change scene script during conversation

Posted: Fri Jul 16, 2021 10:21 am
by sch
Works good thanks !

Re: Execute change scene script during conversation

Posted: Fri Jul 16, 2021 10:50 am
by Tony Li
Glad to help!