Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
4
Question by ZCzattis · Dec 29, 2016 at 09:41 PM · buttonscene-change

button that change scene on click

Hi im a noob at scripting and i need a script or something that make that when we click on a button it change the scene i tried a lot of script that i found on the forum but none of them work for me so i someone could help me i will be grateful PS : Sorry for my bad english it's not my native language

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image EnchantedDonutStudioz · Dec 21, 2021 at 08:19 PM 0
Share

I'm a noob too, so I have this question toooooo.

5 Replies

· Add your reply
  • Sort: 
avatar image
6

Answer by nordaj123 · Dec 31, 2016 at 01:41 AM

do something like this:

 using UnityEngine.SceneManager;
 
 ...
 
 void OnMouseUp()
 {
     SceneManager.LoadScene("SceneName", LoadSceneMode.single);
 }

You will also want to go into build settings and add all scenes into the list. Then you will need to add a 2d collider to your button. This is only the loading scene parts but you can do other things like changing the button size OnMouseDown.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
3

Answer by mafanbong8819 · Jan 30, 2017 at 06:37 AM

Here is a video tutorial to change scene using button, i think is clear cause most of the step is zoom, so you can read it easily.

video-change scene using button

  1. add this script to the main camera

  2. create a button

  3. from the inspector of UIbutton, over the onclick() function, add camera as object, then choose function call menuscript, then select change scene function.

  4. open new scene

  5. add scene to the platform

  6. done.

    using Unityengine; using System.Collections;

    public class MenuScript : MonoBehaviour { public void ChangeScene(string sceneName) { Application.LoadLevel(scenceName); } }

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Prisec · Mar 18, 2020 at 10:36 AM 0
Share

lmao that tutorial is so low quality got any other vids?

avatar image
0

Answer by SamTam · Jan 16, 2017 at 10:07 AM

On you're script just add:

public void OnMouseClick(){ Application.LoadLevel("Here put the name of the scene"); }

Then select the button and scroll down until you find Button script. At the bottom of the component there should be a "On click ()".

Then put the script bellow the "On click()" then next to it there it should say No Function. Click on that and find you're script's name and select OnMouseClick() option.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by OwlTeaGames · Sep 30, 2017 at 06:51 PM

Here is a video I made of How To Change Scenes with the latest unity build, 2017. It's part of a VR series but should work just fine for any project! https://youtu.be/MeWjyLpsYw8!

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image JMcGregor · Feb 14, 2018 at 10:58 PM 0
Share

Video is broken

avatar image BGrizzR · Jun 27, 2018 at 01:52 AM 0
Share

Just remove the exclamation point, then the link works. @J$$anonymous$$cGregor

avatar image
0

Answer by Huzaifa220 · Sep 26, 2019 at 05:45 AM

using UnityEngine.UI;

public string sceneName; public Button loadSceneBtn;

void Start(){ loadSceneBtn.onClick.Addlistner(ChangeScene); }

void ChangeScene(){ SceneManager.LoadSceneAsync(sceneName); }

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

102 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Scene Buttons not working after scene switch 0 Answers

Why is my scene not loading? 2 Answers

Wait until video is over to show canvas,Wait until Video is over to show canvas 0 Answers

Someone Can Help me with this? Get scene id to load in prox level 0 Answers

How to prevent button click when changing scene? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges