Button click to change Scene

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
M4ri3l
Posts: 1
Joined: Thu Aug 01, 2024 6:50 pm

Button click to change Scene

Post 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!
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Button click to change Scene

Post 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 418 times
Post Reply