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
0
Question by Madrig88 · May 13, 2016 at 01:59 AM · buttonsgameobjects

Cannot click 4.6 GUI when attached to a Game object

Using the 4.6 GUI I am unable to click any of the buttons under the red square.

I have been using the old GUI system for the longest time, i had decided to try and use the newer 4.6 GUI to perform this task. I started out with a canvas component attached to the square that draws the 4 buttons underneath the sprite and on runtime, it won't click.

After I noticed that wasn't working, I also tried to remove the canvas component, and go with a canvas and event system separate from the game object in question. when I run the game, it still won't click. Is there anything that I am missing in this?

Also, i am running Unity 5.1.1f1 if that makes a difference.

Thanks in advance everyone.

alt text

btn-problems.jpg (15.5 kB)
Comment
Add comment · Show 2
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 Naphier · May 13, 2016 at 06:22 AM 0
Share

Hard to tell without seeing your hierarchy setup and components for the go with the button on it. There's some pretty quick tutorials on how to use the new GUI system.

avatar image Madrig88 · May 15, 2016 at 04:48 PM 0
Share

The images below show how the hierarchy and components are set up. The piece script only snaps the piece to the grid, and then sets the inactive buttons to active.

I have tried to attach the canvas component to the object, and I have tried it without the component with the same result. I've tried it with the canvas and event system on its own, and without them at all. Also same result. Any ideas would be greatly appreciated.

btn-heirarchy

btn-components

btn-components.jpg (53.9 kB)
btn-heirarchy.jpg (18.5 kB)

1 Reply

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

Answer by Naphier · May 15, 2016 at 05:36 PM

I fear you're not using the GUI system as intended.

  1. Add canvas

  2. Add GUI objects as children to that canvas

  3. With GUI Buttons add events to On Click.

A rigidbody on a canvas may interfere with that canvas. I'm not certain, I've never tried because it doesn't make a lot of sense to have a canvas with a rigidbody, Also note that the GUI has image objects.

Again, I'd highly suggest checking out the tutorials. It looks like you're making a board game. They have a full tutorial on making a tic-tac-toe game using only UI which may be of great help to you:

http://unity3d.com/learn/tutorials/topics/user-interface-ui

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 Madrig88 · May 15, 2016 at 08:17 PM 1
Share

Thank you this has helped quite a bit.

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

55 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

Related Questions

How would I select GameObjects from an array one by one? 1 Answer

Car Rotation when pressing buttons 0 Answers

How do I get an object to turn in the direction another object is facing? 0 Answers

If Mouse cursor is above an object, start animation (without click on It) 2 Answers

How to make multiple buttons 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