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 highpockets · Feb 05, 2014 at 04:35 AM · guiperformancescroller

GUI buttons or 3D Objects as GUI?

Hello,

I've been creating a scrolling game for mobile where the axes of scrolling changes between x and z depending on the player's whereabouts. Until now, I've been using triggers to change the scrolling direction, which works great, but I want to allow for more control over changing between the scrolling direction with some kind of a GUI.

I have not worked with the GUI thus far. My idea is to have an arrow appear and disappear while the player is on a trigger. I was originally thinking of just using a 3D arrow with a box collider and sending a raycast from the camera based on the touch position ( or not using a collider (for performance) and just detecting when the touch position is in line with the object ) since I'm already using this approach for interacting with game objects in my scene.

Is this a good idea?? Or should I use the GUI system instead? I don't mind creating a custom texture for use with the GUI system if this will in some way be better for performance.. Is there a reason why to use the GUI system instead of using my approach?

Thanks in advance!!

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

1 Reply

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

Answer by Triqy · Feb 05, 2014 at 06:00 AM

you don't have to use the GUI system that unity provides.. here is some custom GUI button Code that I put up awhile back...

http://answers.unity3d.com/questions/422187/android-guitexture-touch.html

Just slap this in a Java Script and slap that on a Custom GUI you created and you have a button for mobile games.

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 highpockets · Feb 05, 2014 at 08:11 AM 0
Share

Thanks, but I know that I don't have to use the unity GUI system. I was wondering if a GUI system (unity's/custom) is a better idea, performance wise, than using my alternative...

What is the overhead of GUItextures as buttons??

For a 3D object, there would be the overhead of rendering the geometry and the texture that it has, along with a way for detecting the touch ( collider or checking the touch position against the object position ) which would include calculations such as what raycasting executes or cameratoworldpoint. I'm sure that the 3D object route would include much more processing because it seems to me that a GUITexeture is simply just a texture with no geometry in screen space which excludes the 3D environment calculations. Am I correct?

I want to point out that with your code, there is no need to check every frame if the ShowGUI is true. Unless you want to have it shown at all times. Send an event out when you want to show/hide the GUI and then the GUITexture script can start a coroutine with a while loop that detects if it is suppose to show or hide the texture. Sorry, I try keeping things out of Update if not completely necessary because it is running once per frame.

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

19 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

Related Questions

How expensive are legacy GUI Matrix changes / RotateAroundPivot performance wise? 0 Answers

Filling image without compromises 0 Answers

GUI alternatives ? 1 Answer

GUI Menu Major Performance Issues 1 Answer

iOS performance: GUItext? want to use text string, but how to instantiate and edit it runtime? 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