Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by cariaga · Nov 20, 2014 at 04:56 AM · buttonunity 4.6instantiate prefabunityui

[Solved] why dosen't Unity 4.6 New UI button work when you instantiate it on playmode?

when you dynamically instantiate a button it wont work in play mode.but if you instantiate it on edit mode its works. is this a unity 4.6 bug? the UI button script seams to fail at triggering e.g highlight color , pressed color etc.. i already tried searching everywhere it seams nobody asked the question yet.

p.s the instantiated button is in the canvas

Extra tags for search-ability . Unity , UI , cloning , button , canvas , drop , down ,Unity 5 , menu , vertical menu , horizontal menu , Gird Menu , instantiate , Duplicate , run time , play mode, edit mode , event trigger , event system , onhover , onEnter , onPointer , OnExit , Event listener

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

2 Replies

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

Answer by Kiwasi · Nov 20, 2014 at 05:05 AM

I've answered this question three times already this week. :) Its a well known fact that searchability of UA sucks.

There are a couple of things to check when instantiating a button

  • The button must be the child of a canvas

  • There must be an event system present in the scene

  • You have to add listeners via script

To see a video where I write a script that does all of this check out my YouTube video here.

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 cariaga · Nov 20, 2014 at 05:15 AM 0
Share

WOW thank you.. i can't believe UA is like that might be because UA isn't as strict as stackoverflow but at least UA is very welco$$anonymous$$g if i had to ask this on overflow ill get down voted right way. anyway thanks a lot :)

avatar image joshnaro · Feb 25, 2015 at 11:32 PM 0
Share

Wow, just spent an hour digging into this one. I must have deleted my event system accidentally. Thanks a ton.

avatar image
2

Answer by cariaga · Nov 21, 2014 at 03:36 AM

ALTERNATIVE SOLUTION

it is actually a version problem in unity 3D 4.6b7 doesn't support button instantiate where it includes the listener BUT this can be fixed by updating unity3D that is if the dynamic button instantiation is the problem

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

27 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

Related Questions

How to understand if 4.6 UI button is highlighted? 3 Answers

Unity 4.6: Convert GameObject into a UI.Button 2 Answers

need my function to take 2 variables and show in OnClick list 3 Answers

Unity 4.6 UI do something while button is pressed 1 Answer

Unity 5 UI Button OnClick 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