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 reptilebeats · Mar 24, 2012 at 03:21 AM · updatefixed

Update for gui

Hey im developing for ios and i have heard a lot about assigning gui to an update function instead of a fixed. I can understand why but how would i go about doing this when the gui control an object like a car for instance.

So when i press on go the cars back wheels move, would it matter that my gui is in a fixed as the user has to hold go in order for the car to go. This is what i dont understand, do i have to put the go in update and check it in a fixed for it being pressed.

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

Answer by You! · Mar 24, 2012 at 05:24 AM

If this input is only required once, what you are doing should be fine. For example, if starting required pressing a GUI button and the rest of the controls were tilt based, what you are doing is perfect and also optimizing your game.

If you want to completely control the car from the GUI, it is preferred to use the "Update function" OnGUI(). For example, a button could be use to control whether or not the car is accelerating throughout the whole game, giving the player an option to stop or slow to a stop, depending on what is wanted.

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 reptilebeats · Mar 24, 2012 at 10:57 AM 0
Share

Well at the momment all my menu items like pause and mainmenu are in update so as they are not effected by time.

For the game though when i hold a button down the car will move, so would it be better if i just leave it in fixed update. Rather than checking it.

Imagine i have a control manager script and it has all the controls in it and gui, to prevent less scripts being updated, and at the momment in fixed it says on touch addtorque,

Would it be a better solution to have a fixed update check say a off and on button inside the update which is controled by the touch

Just trying to squeze as much in without causing lag. $$anonymous$$y game is very physics based and is already close to lag on some objects, but this is before compression and lightmapping.

Thanks for the reply

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Interpolated Fixed Timestep 2 Answers

What do I need to know when caching the results of a raycast every frame? 1 Answer

fixed update predicament 1 Answer

Which functions to which update, got confused 0 Answers

even just cubes moving seems choppy 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