Page 1 of 1

Button click to change Scene

Posted: Mon Aug 05, 2024 5:59 am
by M4ri3l
Hello, I tried this method: "Dialogue System for Unity 2.x - Scene Events"

https://www.youtube.com/watch?v=8KaIImp ... elCrushers

to make an object appear, which is a button.
After clicking that button another scene should appear.
But it's not working.

I only have dialogue in the scene and i dont know how to change it otherwise.

Thanks in advance for your help!

Re: Button click to change Scene

Posted: Mon Aug 05, 2024 9:03 am
by Tony Li
Hi,

Do you want Unity do change from the current scene to another scene?

If so, then here are some easy ways:

In all cases, add the second scene to your project's build settings.


If you want to make a conversation change the scene:
In the conversation's dialogue entry where you want change scenes, set the Sequence field to:

Code: Select all

required LoadLevel(your-scene);
Continue()
where "your-scene" is the name of the second scene.


If you want to make the conversation activate UI button that the player can click to change scenes:

1. Use your conversation's OnExecute() scene event to activate the UI button.

2. On the UI button, add a Save System Methods component. Configure the Button component's OnClick() event to call SaveSystemMethods.LoadScene:

loadScene.png
loadScene.png (27.13 KiB) Viewed 419 times