Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 /
avatar image
3
Question by lactus · Dec 14, 2014 at 02:07 AM · canvasraycastingbuttons

Canvas Buttons not working after LevelLoad

I made a UI in the new canvas system. The canvas is placed in the Menu screen and made into an Unity-Singleton with DontDestroyOnLoad(true). The canvas uses the "Screen Space - Camera" option.

While in menu screen everything works perfectly - the buttons get highlighted when hovered and can be clicked. After loading a new Level the buttons do not work anymore. They don't react on hovering or clicks. There was no change done to the canvas while switching the level and I have no idea what is causing this trouble.

EDIT: I found a fix: somehow there was no eventsystem attached to the canvas, adding this made it work. But I still want to know why. Why does it work without the eventsystem in the first scene and not in the second one?

Greetings, lactus

Comment
Add comment
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

5 Replies

· Add your reply
  • Sort: 
avatar image
23
Best Answer

Answer by Kiwasi · Dec 14, 2014 at 02:08 AM

You need one event system somewhere in your screen for the UI to work. Typically it should be on its own GameObject.

When you create a canvas the event system gameobject is created for you automatically.

Comment
Add comment · Show 8 · 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 bodec · Jan 12, 2015 at 01:57 AM 0
Share

I had this same issue and forgot about the event system im parented it to my canvas and I have no problems anymore thanks.

On a side note the person who asked this question if its a solved issue please mark the answer correct.

avatar image grimmy · Apr 20, 2015 at 08:40 PM 1
Share

It's also worth noting that if you somehow have 2 event systems in your scene the buttons will also stop working. You get a yellow warning message but it's easily missed.

avatar image roshan67890 · Oct 12, 2015 at 12:59 PM 0
Share

i am facing the problem even if the event manager is present! plz help...

avatar image Xenocide roshan67890 · Jan 06, 2017 at 11:13 PM 0
Share

Yeah I have no idea what my problem is. $$anonymous$$y buttons work fine when I enter the scene, but the buttons stop working completely when I enter the scene from another scene. Both occasions everything is the same; event system, buttons, canvas. Nothing has changed with them and yet the buttons become inactive when I enter from another scene.

Edit: I fixed my problem. Turned out the scene I was transitioning from had a DontDestroyOnLoad script attached to it. When I unchecked this the buttons work when I transition from that scene to the one with previously inactive buttons. Very strange, especially considering that script tells it to delete when it enters that scene (so it techinically does destroy itself when it loaded into the scene). Seems like the event system absolutely hates having any DontDestroyOnLoad components attached to it...

avatar image AltSim · Apr 22, 2017 at 06:49 PM 0
Share

this worked for me thx :) I just added the eventSystem to DontDestroyOnLoad Object

avatar image Nemanja2001 · Jul 16, 2017 at 06:57 AM 0
Share

Thank you so much!

Show more comments
avatar image
2

Answer by ad172 · Dec 14, 2016 at 06:55 AM

I had the same issue, but I checked "Force Module Active" in "Standalone Input Module (Script)" in the EventSystem and it worked fine.

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
1

Answer by Fdudka · Mar 23, 2016 at 11:38 AM

try adding Time.timeScale = 1; at Start(){}

Comment
Add comment · Show 4 · 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 RealismWorld · Sep 04, 2018 at 07:06 PM 0
Share

That´s it! Thanks!

avatar image MudPuppet · Oct 19, 2018 at 06:08 AM 0
Share

Time.timeScale = 1 in Start method worked for me too. $$anonymous$$uch thanks!

avatar image raitoryuukuu · Jul 09, 2021 at 07:56 AM 0
Share

it worked ! thanks so much i love you

avatar image torbiner21 · Dec 28, 2021 at 09:42 PM 0
Share

I LOVE YOU !!!!!!!

You literally saved my hours of searching !!

avatar image
1

Answer by bdilloughery_mvla · Apr 29, 2019 at 01:57 PM

Tried all of these and didn't fix it. Finally found my problem:

I'm using the standard 1st person controller asset, and it locks the cursor. Need to unlock the cursor when going back to the main menu.

In the past I have had: 1. UI textbox/image is on top of button so it isn't clickable 2. DontDestroyOnLoad doing wonky things

Cheers

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 Schalke · Jul 23, 2019 at 05:30 PM 0
Share

Thanks, fixed my issue as well.

avatar image
0

Answer by SortOth · Aug 23, 2019 at 05:52 PM

For me, it was failing because I loaded level like this:

SceneManager.LoadScene("Preview", LoadSceneMode.Additive);

But now I load it with

LoadSceneMode.Single

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 ahsen35813 · Mar 25, 2020 at 10:42 PM 0
Share

Don't you do it like this?:

 Scene$$anonymous$$anager.LoadScene("Level X")

Or like this?

 public string levelToLoad;
 
 void Start(){
     Scene$$anonymous$$anager.LoadScene(levelToLoad);
 }

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

21 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

Related Questions

HELP! Buttons stop working when made a child of a "Canvas Group" empty in 4.6.3f1? 4 Answers

Buttons scale keep changing to 0 when I import them to a non-active parent 0 Answers

How can I select a UI element with a raycast from another UI element? 2 Answers

UI Button : Previously working but now it's not working 0 Answers

Canvas Button need to be pressed higher on certain Android Phones 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