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 felixpk · Jun 25, 2015 at 12:38 PM · c#performanceoptimizationbestpracticeslateupdate

Low Priority Methods In LateUpdate?

Hey there, just a quick question! Is it recommended to call all "low priority methods" via LateUpdate? Methods like setting/getting the score and updating it on the UI.

I appreciate any suggestions!

Felix

Comment
Add comment · Show 1
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 Nerevar · Jun 25, 2015 at 12:52 PM 1
Share

LateUpdate is called once all the Update() functions your monobehaviour scripts are done processing. (So in your case the scoring operations would be called after all the operations you can have in your updates)

Unless your scoring functions are influencing the game physics you should not pay attention whether or not it should be made in Update or LateUpdate.

I$$anonymous$$O there is no general rule. There are particular cases where you do have to use LateUpdate(), FixedUpdate(), I never encountered them so far as I rarely work with physics.

you also have posts on the forum about the topic, here is one.

Edit : old question.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by YoungDeveloper · Jun 25, 2015 at 12:47 PM

LateUpdate is executed after Update, it would make sense to update camera positions there. Transform is moved in update and later the camera, that would exclude the possibility for camera jitter - camera is updated before actual movement. This is just one example i can think out of the head.

Comment
Add comment · Show 3 · 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 felixpk · Jun 25, 2015 at 01:04 PM 0
Share

Thanks for your answer! But the actual question is: can I save processing power by Calling these functions from LateUpdate()? It's not that I want to avoid Jittering or something, the score update could be easily called just once every second. Should I start a CoRoutine?

avatar image Nerevar · Jun 25, 2015 at 01:36 PM 0
Share

@felixpk yes you could also use a coroutine and invokeRepeating() to update scores every seconds, but you can also do that in update (calling the function every X number of frames).

avatar image Bunny83 · Jun 25, 2015 at 11:41 PM 0
Share

@felixpk: To answer that question in the comment: No, LateUpdate will not save any processing power as it is called exactly as often as Update, just later during the frame. It's ment to do things "in the right order". So in LateUpdate you can be sure that all Update functions has already been processed for this frame.

LateUpdate is actually the exact same thing as Update just called later. If you want to update something at larger intervals InvokeRepeating would be the best solution. Of course you can also use a coroutine, but InvokeRepeating is easier.

ps: Your original question is very confusing as you presented your "solution" using LateUpdate in a case where LateUpdate makes no sense at all ^^. When you ask a question you should focus on the actual question. In addition you can suggest / ask if a certain method / way might be the solution but the question should be about your actual problem. In your case you probably want to improve performance by not calling certain things every frame but at certain intervals.

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

22 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

Related Questions

Mesh.CombineMeshes does not work when mergeSubMeshes=false 2 Answers

Speed and efficiency of enabling/disabling component? 1 Answer

Distribute terrain in zones 3 Answers

Optimization Question about Singleton 2 Answers

Memory management and C# do's and don'ts? 5 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