Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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
2
Question by Stonebolt · Dec 26, 2015 at 11:16 AM · buttonuser interfaceprefab-instance

Prefab Canvas's buttons arn't working in different scene

Hello,

I mad a Canvas prefab in a scene called, say, Scene 1 that has a UI Camera parented to it. This Canvas has scripting that controls several different menus and HUD ammo + health.

I made this Canvas into a prefab, but when I bring an instance of it into another scene, say Scene 2, the on screen buttons don't work and cant be interacted with. Everything else is working fine with the prefab Canvas in Scene 2, like the health and ammo display and update, but I just can't click the actual UI on screen buttons. Also, the controllers "Start" button and "Escape" key still work to pause and unpause the game and are contained in the same script that the buttons send methods to.

Also I deleted the original Canvas that I used to make the prefab out of Scene 1, then tried dragging another instance back into Scene 1, and the buttons still work fine. I can't figure out why the buttons aren't working with the Canvas prefab in Scene 2. Any ideas would be appreciated.

It feels like something might be blocking the mouse cursor from the buttons, but I'm not changing anything in the prefab and I'm pretty sure my script doesn't depend on the name of the first scene to make the buttons work.

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 Stonebolt · Dec 24, 2015 at 06:18 PM 1
Share

Herp derp I figured it out. I didn't put an Event System in Scene 2, so the buttons where not interactable. Everything works fine now.

4 Replies

· Add your reply
  • Sort: 
avatar image
11

Answer by CELL_FISH · Aug 01, 2017 at 01:52 PM

Please check, whether there is an Event system in the Scene. I've had a similar issue and that was the answer.

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 evanwr9 · Nov 09, 2020 at 11:37 PM 0
Share

Just simply the existence of a EventSystem?

avatar image totuomin · Jun 02 at 01:06 PM 0
Share

Thank you, this solved my problem.

avatar image
1

Answer by asymmetry · Apr 21, 2021 at 10:27 AM

Make sure that there is exactly one EventSystem in the scene.

I built my UI in one scene, which automatically created the EventSystem in that scene (and I didn't note it at the time). I built all of my UI under a root GameObject "EmptyLevelUI" and created a prefab from that root object. Then I brought that EmptyLevelUI prefab into another scene and couldn't figure out why nothing was happening when I clicked my buttons. Of course the issue was that there was no EventSystem in the second scene. I actually chose to move the EventSystem into my "EmptyLevelUI" Prefab, which of course I imagine would break if I ever tried to create multiple instances or if there was another previously existing EventSystem in the scene, but since (at least at the moment) I'm only ever planning on using the EventSystem for my UI, that solution worked well for me, and now I can just drop my EmptyLevelUI prefab in each scene and I'm done, I don't have to remember to create a separate EventSystem each time.

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
0

Answer by evanwr9 · Nov 10, 2020 at 01:28 PM

I had a problem similar to this and the reason to it was that I was trying to make changes to the panel prefab in the new scene rather than making changes to the prefab itself by selecting it from the project files. When I pulled up the prefab itself all the changes I was attempting to make went through just 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
0

Answer by Christopher-Taljaard · Dec 06, 2020 at 12:49 PM

Also try checking that the graphic raycaster component on the parent canvas is ticked on, mine for some reason switched off in my prefabs but was checked in my initial instance.

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

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

9 People are following this question.

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

Related Questions

Can someone explain this error? 1 Answer

In the new UI system is there any way to track where the mouse is when over a button or other UI control? 2 Answers

Use UI buttons with Time.timeScale=0? 3 Answers

UI Animation breaks default button color fade effect, 0 Answers

Having issues determining a way to use buttons in a script. 2 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