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
0
Question by Tyrebear · Mar 23, 2014 at 08:36 AM · guiobjectsbuttonsworldspace

How Can I Create Buttons In World Space and NOT Screen Space

From my understanding unity can provide basic GUI functionality with its built in features, however I need to have buttons that aren't flat against the screen and are actually attached to an object. I am creating a first person restaurant management game and the player can select a variety of functions from a screen attached to their counter. Much like when you go to burger king or McDonalds and the cashier takes your order on a touchscreen in front of them. How can I achieve this?

Comment
Add comment · Show 4
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 Benproductions1 · Mar 23, 2014 at 08:47 AM 0
Share

Are you asking about a 3d user interface or just positioning the 2d GUI elements above/on objects in 3d space?

avatar image Tyrebear · Mar 23, 2014 at 08:53 AM 0
Share

That's a tough question but from what I Googled it seems like a 3d user interface would be what I'm looking for.

avatar image Benproductions1 · Mar 23, 2014 at 09:03 AM 0
Share

You can't achieve that with the standard UI library. You will need to find something on the asset store or make your own.

avatar image robertbu · Mar 23, 2014 at 04:52 PM 1
Share

The third-party packages NGUI and EZGUI will make your job creating buttons and other interfaces in world space easier. The do cost a bit of money though. Here is a showcase video for EZGUI.

http://www.anbsoft.com/content/ezgui/ez_gui_showcase/index.html

It is rumored that Unity's long promised new interface classes will be based on NGUI, so if it has the features you need, that would be the way to go. I use EZGUI, but NGUI did not exist when I made that choice.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by byerdelen · Mar 23, 2014 at 09:52 AM

camera.WorldToScreenPoint would work up to a point. The targets world point will be translated to the screen point so it will be like it is attached to the target.

http://docs.unity3d.com/Documentation/ScriptReference/Camera.WorldToScreenPoint.html

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 Owen-Reynolds · Mar 23, 2014 at 04:37 PM

For true world text, use 3dText (TextMesh in the code, but 3DText from the drag down.) Put the text entirely in world-space. If you put one on the side of a cube, it will like it's really written there. Only weird thing is it shows through everything (such a solid objects in front of it.) There are fixes here involving shaders (paste-in code.)

May as well use 3D models for the buttons.

For the check, raycasts seem the most versatile. The standard "what in the world is my mouse over?"

For comparison, using WorldToScreen and GUIText, as byerdelan suggests will have unchanging size and never rotated. Will look more like a computer is adding labels to a picture. Which might be easier to use and realistic enough.

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 Benproductions1 · Mar 24, 2014 at 07:46 AM 0
Share

The question was about GUI buttons and other such functionality, which goes way beyond simple clickable text. Actual 3d GUI libraries would be much more appropriate for the job (and also much faster) ;)

avatar image Owen-Reynolds · Mar 24, 2014 at 03:54 PM 0
Share

The question was about simulating buttons which "aren't flat" on the employee-end of a modern cash register. The replies are about GUI buttons!

If the OP really wants fully 3D buttons, looking and acting exactly like the real thing, they'll probably have to make it themselves, using 3DText and background planes. Tools the wonderful people at Unity have thoughtfully provided for us to do this.

The comments are steering towards "do you really need full 3D? Wouldn't a straight-on cash-register-view work as well?" And I agree. The only reason to go to the trouble of real 3D is if you want to simulate glancing down at the resister, or looking over at Hal's register, or maybe see your fingers (maybe showing the thumb tapping TO GO?)

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

23 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

Related Questions

How would I go about making a tempo? Also, how would I make a sequencer to accurately react to the tempo meter? 0 Answers

Main menu help needed (C#) 2 Answers

Putting Dictionary/List using foreach as buttons in a scroll view? 3 Answers

GUI Display Help 0 Answers

how to listing all game objects in GUI.Box? 1 Answer


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